Image signal encoding/decoding method and device for same

ABSTRACT

An image decoding method according to the present invention may comprise: splitting a picture into a plurality of tiles; and determining at least one slice on the basis of the plurality of tiles. Here, splitting a picture into a plurality of tiles may comprise: determining the width of a first tile column in the picture; and determining the width of a second tile column neighboring the first tile column.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit under 35 U.S.C. section 371, of PCTInternational Application No.: PCT/KR2020/002752, filed on Feb. 26,2020, which claims foreign priority to Korean Patent Application No.:10-2019-0022760, filed on Feb. 26, 2019 and Korean Patent ApplicationNo.: 10-2019-0080408, filed on Jul. 3, 2019, in the Korean IntellectualProperty Office, the disclosures of which are hereby incorporated byreference in their entireties.

FIELD OF THE DISCLOSURE

The present disclosure relates to a video signal encoding/decodingmethod and a device therefor.

DESCRIPTION OF THE RELATED ART

As display panels become larger, video service of higher quality isrequired. The biggest problem with high-definition video service is thatan amount of data is greatly increased. In order to solve the aboveproblem, research for improving the video compression rate is beingactively conducted. As a representative example, the Joint CollaborativeTeam on Video Coding (JCT-VC) was formed in 2009 by the Motion PictureExperts Group (MPEG) and the Video Coding Experts Group (VCEG) under theInternational Telecommunication Union-Telecommunication (ITU-T). TheJCT-VC proposed High Efficiency Video Coding (HEVC), a video compressionstandard that has about twice compression performance of H.264/AVC, andthat was approved as standard on Jan. 25, 2013. However, with rapiddevelopment of high-definition video services, the performance of HEVCis gradually showing its limitations.

DISCLOSURE Technical Purpose

A purpose of the present disclosure is to provide a method forpartitioning a picture into a plurality of tiles or a plurality ofslices in encoding/decoding a video signal, and a device for performingthe method.

A purpose of the present disclosure is to provide a method forpartitioning a slice based on a tile index in partitioning a pictureinto a plurality of tiles, and a device for performing the method.

A purpose of the present disclosure is to provide a method foradaptively determining whether a tile index is encoded/decoded accordingto a position of a slice in partitioning a picture into a plurality ofslices, and a device for performing the method.

Technical purposes obtainable from the present disclosure arenon-limited to the above-mentioned technical purposes, and otherunmentioned technical purposes may be clearly understood from thefollowing description by those having ordinary skill in the technicalfield to which the present disclosure pertains.

Technical Solution

A video signal decoding method according to the present disclosure mayinclude decoding information representing a slice determination method;and defining at least one tile as a slice when a current picture ispartitioned into a plurality of tiles. In this case, informationrepresenting the slice determination method may represent whether it isdefined based on a definition method based on a raster scanning order ora definition method based on a rectangular shape. In addition, when theslice determination method represents a definition method based on arectangular shape, a first slice may be defined based on a tile at apreset position in the first slice, and when the first slice is not alast slice in the current picture, a first syntax for identifying thetile at a preset position in the first slice may be parsed in abitstream, and when the first slice is a last slice in a picture, theparsing of the first syntax may be omitted.

A video signal encoding method according to the present disclosure mayinclude decoding information representing a slice determination method;and defining at least one tile as a slice when a current picture ispartitioned into a plurality of tiles. In this case, informationrepresenting the slice determination method may represent whether it isdefined based on a definition method based on a raster scanning order ora definition method based on a rectangular shape. In addition, when theslice determination method represents a definition method based on arectangular shape, a first slice may be defined based on a tile at apreset position in the first slice, and when the first slice is not alast slice in the current picture, a first syntax for identifying thetile at a preset position in the first slice may be encoded in abitstream, and when the first slice is a last slice in a picture, theencoding of the first syntax may be omitted.

In a video signal decoding method according to the present disclosure,the first syntax may represent an index difference value between thetile at a preset position in the first slice and a tile at a presetposition in a second slice.

In a video signal decoding method according to the present disclosure,the first syntax may represent a value subtracting a predetermined valuefrom an index difference value between the tile at a preset position inthe first slice and a tile at a preset position in a second slice.

In a video signal decoding method according to the present disclosure,when the first slice is not a last slice in the current picture, asecond syntax representing a size of the first slice may be additionallyparsed/encoded and when the first slice is a last slice in the currentpicture, the parsing/encoding of a second syntax may be omitted.

In a video signal decoding method according to the present disclosure,when the slice determination method represents a definition method basedon a raster scanning order, the first slice may be determined based onthe number of tiles included in the first slice, and when the firstslice is not a last slice in the current picture, a third syntaxrepresenting the number of tiles included in the first slice may beparsed/encoded, and when the first slice is a last slice in a picture,the parsing/encoding of the third syntax may be omitted.

It is to be understood that the foregoing summarized features areexemplary aspects of the following detailed description of the presentdisclosure without limiting the scope of the present disclosure.

Technical Effect

According to the present disclosure, encoding/decoding efficiency may beimproved by partitioning a picture into a plurality of tiles or slices.

According to the present disclosure, encoding/decoding efficiency may beimproved by partitioning a slice based on a tile index.

According to the present disclosure, encoding/decoding efficiency may beimproved by adaptively determining whether a tile index isencoded/decoded according to a position of a slice.

Effects obtainable from the present disclosure may be non-limited by theabove-mentioned effect, and other unmentioned effects may be clearlyunderstood from the following description by those having ordinary skillin the technical field to which the present disclosure pertains.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a view showing a block diagram of a video encoding device(encoder) according to an embodiment of the present disclosure;

FIG. 2 is a view showing a block diagram of a video decoding device(decoder) according to an embodiment of the present disclosure;

FIG. 3 is a view showing a basic coding tree unit according to anembodiment of the present disclosure;

FIG. 4 is a view showing various partitioning types of a coding block.

FIG. 5 is a view of an example showing an aspect of partitioning a CTU.

FIG. 6 is a flow diagram of an inter prediction method according to anembodiment of the present disclosure.

FIG. 7 is a flow diagram of a process deriving the current block motioninformation under a merge mode.

FIG. 8 is a diagram of illustrating candidate blocks used to derive amerge candidate.

FIG. 9 is a diagram to explain an example of determining a motion vectorper sub-block.

FIG. 10 is a diagram to explain the update aspect of a motioninformation table.

FIG. 11 is a diagram showing the update aspect of a motion informationtable.

FIG. 12 is a diagram showing an example in which the index of apre-saved motion information candidate is updated.

FIG. 13 is a diagram showing the position of a representative sub-block.

FIG. 14 shows an example in which a motion information table isgenerated per inter-prediction mode.

FIG. 15 is a diagram showing an example in which a redundance check isperformed only for a part of merge candidates.

FIG. 16 is a diagram showing an example in which a redundance check witha specific merge candidate is omitted.

FIG. 17 is a flow diagram of an intra-prediction method according to anembodiment of the present disclosure.

FIG. 18 is a diagram showing intra-prediction modes.

FIG. 19 and FIG. 20 are a diagram showing the example of aone-dimensional array in which reference samples are arranged in a row.

FIG. 21 is a diagram illustrating an angle formed by directionalintra-prediction modes with a straight line parallel to an x-axis.

FIG. 22 is a diagram showing an aspect in which a prediction sample isobtained in case that a current block has a non-square shape.

FIG. 23 is a diagram showing wide angle intra-prediction modes.

FIG. 24 is a flow diagram showing a process of determining a blockingstrength.

FIG. 25 shows predefined filter candidates.

FIG. 26 is a diagram showing a picture partitioning method according toan embodiment of the present disclosure.

FIG. 27 shows an example in which a picture is partitioned into aplurality of tiles.

FIG. 28 is a diagram for explaining a generation aspect of a brick.

FIGS. 29 and 30 are a diagram showing an example in which a tile groupis defined based on the raster order.

FIG. 31 is a diagram showing an example in which only a rectangular tilegroup is allowed.

DETAILED DESCRIPTION OF THE DISCLOSURE

Hereinafter, embodiments of the present disclosure will be described indetail with reference to the accompanying drawings.

Image encoding and decoding is performed on a basis of a block. In anexample, for a coding block, a transform block, or a prediction block,encoding/decoding processes such as transform, quantization, prediction,in-loop filtering, reconstruction, etc. may be performed.

Hereinafter, an encoding/decoding target block is referred to as a“current block”. In an example, a current block may represent a codingblock, a transform block, or a prediction block according to a currentprocess of encoding/decoding.

In addition, the term “unit” used in the present specificationrepresents a basis unit for performing a specific encoding/decodingprocess, and a “block” may be understood to represent a sample arrayhaving a predetermined size. Unless otherwise stated, “block” and “unit”may be used interchangeably. In an example, in examples described later,a coding block and a coding unit may be understood to have the samemeaning as each other.

FIG. 1 is view showing a block diagram of an image encoding apparatus(encoder) according to an embodiment of the present disclosure.

Referring to FIG. 1, an image encoding apparatus 100 may include apicture partitioning unit 110, prediction units 120 and 125, a transformunit 130, a quantization unit 135, a rearrangement unit 160, an entropyencoding unit 165, a dequantization unit 140, an inverse-transform unit145, a filter unit 150, and a memory 155.

Components described in FIG. 1 are independently illustrated in order toshow different characteristic functions in an image encoding apparatus,and the figure does not mean that each component is constituted byseparated hardware or one software unit. That is, each component is justenumerated for convenience of explanation, at least two components ofrespective components may constitute one component or one component maybe partitioned into a plurality of components which may perform theirfunctions. Even an embodiment of integrating respective components andembodiment of dividing a component are also included in the scope of thepresent disclosure unless they are departing from the spirit of thepresent disclosure.

Further, some components are not requisite components that performessential functions of the present disclosure but are optionalcomponents for just improving performance. The present disclosure may beimplemented with the requisite component for implementing the spirit ofthe present disclosure other than the component used to just improve theperformance and a structure including only the requisite component otherthan the optional component used to just improve the performance is alsoincluded in the scope of the present disclosure.

The picture partitioning unit 110 may partition an input picture into atleast one processing unit. In this connection, the processing unit maybe a prediction unit (PU), a transform unit (TU), or a coding unit (CU).In the picture partitioning unit 110, a single picture may bepartitioned into combinations of a plurality of coding units, predictionunits, and transform units, and the picture may be encoded by selectinga combination of the coding units, the prediction units, and thetransform units according to a predetermined condition (for example,cost function).

For example, a single picture may be partitioned into a plurality ofcoding units. In order to partition a picture into coding units, arecursive tree structure such as a quad-tree structure may be used, anda coding unit that is originated from a root such as a single image orlargest coding unit may be partitioned into other coding units and mayhave child nodes as many as the partitioned coding units. A coding unitthat is no longer partitioned according to certain restrictions becomesa leaf node. Namely, when it is assumed that only square partitioning isavailable for a single coding unit, a single coding unit may bepartitioned into at most four other coding units.

Hereinafter, in the embodiment of the present disclosure, a coding unitmay be used as a unit for encoding or may be used as a unit fordecoding.

A prediction unit may be obtained by partitioning a single coding unitinto at least one square or rectangle having the same size, or a singlecoding unit may be partitioned into prediction units in such a mannerthat one prediction unit may be different from another prediction unitin a shape and/or size.

In generation of a prediction unit based on a coding block to whichintra-prediction is being performed, when the coding unit is not thesmallest coding unit, intra-prediction may be performed withoutperforming partitioning into a plurality of N×N prediction units.

The prediction units 120 and 125 may include an inter-prediction unit120 performing inter-prediction and an intra prediction unit 125performing intra-prediction. Whether to perform inter-prediction orintra-prediction on a prediction unit may be determined, and detailedinformation (for example, an intra-prediction mode, a motion vector, areference picture, etc.) according to each prediction method may bedetermined. In this connection, a processing unit on which prediction isperformed may differ with a processing unit for which a predictionmethod, and detail thereof are determined. For example, a predictionmethod, a prediction mode, etc. may be determined on the basis of aprediction unit, and prediction may be performed on the basis of atransform unit. A residual value (residual block) between the generatedprediction block and an original block may be input to the transformunit 130. In addition, prediction mode information used for prediction,motion vector information, etc. may be encoded using a residual value bythe entropy encoding unit 165 and may be transmitted to the decoder.When a specific encoding mode is used, an original block is encoded asit is and transmitted to a decoding unit without generating a predictionblock through the prediction unit 120 or 125.

The inter-prediction unit 120 may predict a prediction unit on the basisof information on at least one of a previous picture and a subsequentpicture of a current picture, or in some cases, may predict a predictionunit on the basis of information on some encoded regions in the currentpicture. The inter-prediction unit 120 may include a reference pictureinterpolation unit, a motion prediction unit, and a motion compensationunit.

The reference picture interpolation unit may receive reference pictureinformation from the memory 155, and generate pixel information of apixel at an integer or less from the reference picture. In case of aluma pixel, an 8-tap DCT-based interpolation filter having differentcoefficients may be used so as to generate pixel information on a pixelat an integer or less for a ¼ pixel unit. In case of a chroma signal, a4-tap DCT-based interpolation filter having different filtercoefficients may be used so as to generate pixel information on a pixelat an integer or less for a ⅛ pixel unit.

The motion prediction unit may perform motion prediction based on areference picture interpolated by the reference picture interpolationunit. As methods for calculating a motion vector, various methods, suchas a full search-based block matching algorithm (FBMA), a three stepsearch (TSS) algorithm, a new three-step search (NTS) algorithm, etc.may be used. A motion vector may have a motion vector value in a unit of½ or ¼ pixel on the basis of the interpolated pixel. The motionprediction unit may predict a current prediction unit by varying amotion prediction method. As motion prediction methods, various methods,such as a skip method, a merge method, an advanced motion vectorprediction (AMVP) method, an intra block copy method, etc. may be used.

The intra-prediction unit 125 may generate a prediction unit on thebasis of information on a reference pixel around a current block, whichis pixel information in a current picture. When a neighboring block of acurrent prediction unit is a block for which inter-prediction isperformed, and thus a reference pixel is a pixel for whichinter-prediction is performed, a reference pixel included in the blockfor which inter-prediction is performed may be replaced by informationon a reference pixel of a neighboring block for which intra-predictionis performed. In other words, when a reference pixel is unavailable, atleast one reference pixel of available reference pixels may be used inplace of unavailable reference pixel information.

A prediction mode in intra-prediction may include a directionalprediction mode using reference pixel information according to aprediction direction and a non-directional mode not using directionalinformation when performing prediction. A mode for predicting lumainformation may be different from a mode for predicting chromainformation. In order to predict the chroma information, information onan intra-prediction mode used for predicting the luma information orinformation on a predicted luma signal may be used.

In performing intra-prediction, when a prediction unit is identical in asize with a transform unit, intra-prediction may be performed on theprediction unit on the basis of pixels positioned at the left, thetop-left, and the top of the prediction unit. However, in performingintra-prediction, when a prediction unit is different in a size with atransform unit, intra-prediction may be performed by using a referencepixel based on the transform unit. In addition, intra-prediction usingN×N partitioning may be only used for the smallest coding unit.

In an intra-prediction method, a prediction block may be generated afterapplying an adaptive intra smoothing (AIS) filter to a reference pixelaccording to a prediction mode. A type of AIS filter applied to areference pixel may vary. In order to perform an intra-predictionmethod, an intra prediction mode for a current prediction unit may bepredicted from an intra-prediction mode of a prediction unit presentaround the current prediction unit. In predicting a prediction mode fora current prediction unit by using mode information predicted from aneighboring prediction unit, when an intra prediction mode for thecurrent prediction unit is identical to an intra prediction mode of theneighboring prediction unit, information indicating that the currentprediction unit and the neighboring prediction unit have the sameprediction mode may be transmitted by using predetermined flaginformation. When a prediction mode for the current prediction unit isdifferent from prediction modes of the neighboring prediction units,entropy encoding may be performed to encode information on a predictionmode for a current block.

In addition, a residual block may be generated which includesinformation on a residual value that is a difference value between aprediction unit for which prediction is performed on by the predictionunit 120 or 125, and an original block of the prediction unit. Thegenerated residual block may be input to the transform unit 130.

The transform unit 130 may perform transform on a residual block, whichincludes information on a residual value between an original block and aprediction unit generated by the prediction unit 120 or 125, by using atransform method such as discrete cosine transform (DCT) or discretesine transform (DST). In this connection, a DCT transform core includesat least one of DCT2 or DCT8 and a DST transform core includes DST7.Whether to apply DCT, or DST so as to perform transform on a residualblock may be determined on the basis of information on anintra-prediction mode of a prediction unit which is used to generate theresidual block. It is possible to skip a transform for a residual block.A flag indicating whether or not to skip a transform for a residualblock may be encoded. A transform skip may be allowed for a residualblock whose a size is smaller than or equal to a threshold value, aresidual block of a luma component, or a residual block of a chromacomponent under 4:4:4 format.

The quantization unit 135 may perform quantization on values transformedinto a frequency domain by the transform unit 130. A quantizationcoefficient may vary according to a block or importance of an image.Values calculated in the quantization unit 135 may be provided to thedequantization unit 140 and the rearrangement unit 160.

The rearrangement unit 160 may perform rearrangement on coefficientvalues with respect to quantized residual values.

The rearrangement unit 160 may change coefficients in the form of atwo-dimensional block into coefficients in the form of a one-dimensionalvector through a coefficient scanning method. For example, therearrangement unit 160 may scan from a DC coefficient to a coefficientin a high frequency domain by using a zigzag scanning method so as tochange the coefficients into the form of a one-dimensional vector.According to a size and an intra prediction mode of a transform unit,rather than zigzag scanning, vertical directional scanning wherecoefficients in the form of a two-dimensional block are scanned in acolumn direction, or horizontal directional scanning where coefficientsin the form of two-dimensional block are scanned in a row direction maybe used. In other words, which scanning method among zigzag scanning,vertical directional scanning, and horizontal directional scanning isused may be determined according to a size and an intra prediction modeof a transform unit.

The entropy encoding unit 165 may perform entropy encoding on the basisof values calculated by the rearrangement unit 160. Entropy encoding mayuse various encoding methods, for example, exponential Golomb coding,context-adaptive variable length coding (CAVLC), or context-adaptivebinary arithmetic coding (CABAL).

The entropy encoding unit 165 may encode various types of information,such as information on a residual value coefficient and information on ablock type of a coding unit, information on a prediction mode,information on a partitioning unit, information on a prediction unit,information on a partitioning unit, information on a prediction unit andinformation on a transmission unit, information on a motion vector,information on a reference frame, information on a block interpolation,filtering information, etc. obtained from the rearrangement unit 160 andthe prediction units 120 and 125.

The entropy encoding unit 165 may entropy encode coefficients of acoding unit input from the rearrangement unit 160.

The dequantization unit 140 may perform dequantization on valuesquantized in the quantization unit 135, and the inverse-transform unit145 may perform inverse-transform on values transformed in the transformunit 130. A residual value generated by the dequantization unit 140 andthe inverse-transform unit 145 may be added with a prediction unitpredicted by a motion estimation unit, a motion compensation unit, orthe intra-prediction unit which are included in the prediction units 120and 125 so as to generate a reconstructed block.

The filter unit 150 may include at least one of a deblocking filter, anoffset correction unit, and an adaptive loop filter (ALF).

The deblocking filter may remove block distortion that occurs due toboundaries between blocks in a reconstructed picture. In order todetermine whether or not to perform deblocking, whether or not to applya deblocking filter to a current block may be determined on the basis ofpixels included in several rows and columns included in a block. When adeblocking filter is applied to a block, a strong filter or a weakfilter is applied according to required deblocking filtering strength.In addition, in applying a deblocking filter, when performing horizontaldirectional filtering and vertical directional filtering, horizontaldirectional filtering and vertical directional filtering may beconfigured to be processed in parallel.

The offset correction unit may correct an original image by an offset ina unit of a pixel with respect to an image for which deblocking isperformed. In order to perform offset correction on a specific picture,a method of applying a offset to a region which is determined afterpartitioning pixels of the image into the predetermined number ofregions, or a method of applying an offset according to edge informationof each pixel may be used.

Adaptive loop filtering (ALF) may be performed on the basis of a valueobtained by comparing a filtered reconstructed image with an originalimage. Pixels included in an image may be partitioned into predeterminedgroups, a filter to be applied to each of the groups may be determined,and filtering may be individually performed on each group. Informationon whether or not to apply ALF and may be transmitted for each codingunit (CU) for a luma signal, and a shape and a filter coefficient of anALF filter to be applied may vary on the basis of each block.Alternatively, an ALF filter having the same shape (fixed shape) may beapplied regardless of a feature of a block to which the filter will beapplied.

In the memory 155, a reconstructed block or picture calculated throughthe filter unit 150 may be stored. The stored reconstructed block orpicture may be provided to the prediction unit 120 or 125 whenperforming inter-prediction.

FIG. 2 is view showing a block diagram of an image decoding apparatus(decoder) according to an embodiment of the present disclosure.

Referring to FIG. 2, an image decoding apparatus 200 may include: anentropy decoding unit 210, a rearrangement unit 215, a dequantizationunit 220, an inverse-transform unit 225, prediction units 230 and 235, afilter unit 240, and a memory 245.

When an image bitstream is input from the encoder, the input bitstreammay be decoded according to an inverse process of the image encodingapparatus.

The entropy decoding unit 210 may perform entropy decoding according tothe inverse process of the entropy encoding by the entropy encoding unitof the image encoder. For example, in association with the methodsperformed by the image encoder apparatus, various methods, such asexponential Golomb coding, context-adaptive variable length coding(CAVLC), or context-adaptive binary arithmetic coding (CABAC) may beapplied.

The entropy decoding unit 210 may decode information on intra-predictionand inter-prediction performed by the encoder.

The rearrangement unit 215 may perform rearrangement on the bitstreamentropy decoded by the entropy decoding unit 210 on the basis of therearrangement method used in the encoder. Coefficients represented inthe form of a one-dimensional vector may be reconstructed and rearrangedinto coefficients in the form of a two-dimensional block. Therearrangement unit 215 may perform rearrangement through a method ofreceiving information related to coefficient scanning performed in theencoder and of inversely scanning on the basis of the scanning orderperformed in the encoder.

The dequantization unit 220 may perform dequantization on the basis of aquantization parameter received from the encoder and coefficient valuesof the rearranged block.

The inverse-transform unit 225 may perform, an inverse transform, thatis inverse DCT or inverse DST, against to a transform, that is DCT orDST, performed on the quantization result by the transform unit in theimage encoder. In this connection, a DCT transform core may include atleast one of DCT2 or DCT8, and a DST transform core may include DST7.Alternatively, when the transform is skipped in the image encoder, theinverse-transform also not be performed in the inverse-transform unit225. Inverse transform may be performed on the basis of a transmissionunit determined by the image encoder. The inverse transform unit 225 ofthe image decoder may selectively perform a transform method (forexample, DCT, or DST) according to multiple pieces of information, suchas a prediction method, a size of a current block, a predictiondirection, etc.

The prediction unit 230 or 235 may generate a prediction block on thebasis of information related to a prediction block received from theentropy decoding unit 210 and information on a previously decoded blockor picture received from the memory 245.

As described above, as the operation of the image encoder, in performingintra-prediction, when a prediction unit is identical in size with atransform unit, intra-prediction may be performed on the prediction uniton the basis of pixels positioned at the left, the top-left, and the topof the prediction unit. However, in performing intra-prediction, when aprediction unit is different in size with a transform unit,intra-prediction may be performed by using a reference pixel based onthe transform unit. In addition, intra-prediction using N×N partitioningmay be only used for the smallest coding unit.

The prediction units 230 and 235 may include a PU determination module,an inter-prediction unit, and an intra-prediction unit. The PUdetermination unit may receive various types of information, such asinformation on a prediction unit, information on a prediction mode of anintra-prediction method, information on a motion prediction of aninter-prediction method, etc. which are input from the entropy decodingunit 210, divide a prediction unit in a current coding unit, anddetermine whether inter-prediction or intra-prediction is performed onthe prediction unit. By using information required in inter-predictionof a current prediction unit received from the image encoder, theinter-prediction unit 230 may perform inter-prediction on the currentprediction unit on the basis of information on at least one of aprevious picture and a subsequent picture of a current picture includingthe current prediction unit. Alternatively, inter-prediction may beperformed on the basis of information on some pre-reconstructed regionsin a current picture including the current prediction unit.

In order to perform inter-prediction, which method among a skip mode, amerge mode, an AMVP mode, or an intra block copy mode is used as amotion prediction method for a prediction unit included in a coding unitmay be determined on the basis of the coding unit.

The intra prediction unit 235 may generate a prediction block on thebasis of information on a pixel within a current picture. When aprediction unit is a prediction unit for which intra-prediction has beenperformed, intra-prediction may be performed on the basis of informationon an intra-prediction mode of a prediction unit received from the imageencoder. The intra prediction unit 235 may include an adaptive intrasmoothing (AIS) filter, a reference pixel interpolation module, or a DCfilter. The AIS filter may perform filtering on a reference pixel of acurrent block, and whether to apply the filter may be determinedaccording to a prediction mode for a current prediction unit. Aprediction mode of the prediction unit and information on an AIS filterwhich are received from the image encoder may be used when performingAIS filtering on a reference pixel of a current block. When a predictionmode for the current block is a mode to which AIS filtering is notapplied, the AIS filter may not be applied.

When a prediction mode of a prediction unit is a prediction mode forwhich intra-prediction is performed on the basis of a pixel valueobtained by interpolating reference pixels, the reference pixelinterpolation unit may interpolate the reference pixels so as togenerate a reference pixel having a unit of an integer or less. When aprediction mode for a current prediction unit is a prediction mode wherea prediction block is generated without interpolating reference pixels,the reference pixels may not be interpolated. The DC filter may generatea prediction block through filtering when a prediction mode for acurrent block is a DC mode.

A reconstructed block or picture may be provided to the filter unit 240.The filter unit 240 may include a deblocking filter, an offsetcorrection module, and an ALF.

Information on whether or not a deblocking filter has been applied to acorresponding block or picture and information on whether a strongfilter or a weak filter is applied when the deblocking filter is appliedmay be received from the image encoder. The deblocking filter of theimage decoder may receive information on a deblocking filter from theimage encoder, and the image decoder may perform deblocking filtering ona corresponding block.

The offset correction unit may perform offset correction on areconstructed image on the basis of a type of offset correction,information on an offset value, etc. applied to an image when performingencoding.

The ALF may be applied to a coding unit on the basis of information onwhether or not to apply ALF, information on an ALF coefficient, etc.received from the encoder. The above ALF information may be provided bybeing included in a particular parameter set.

In the memory 245, a reconstructed picture or block may be stored so asto be used as a reference picture or reference block, and thereconstructed picture may be provided to an output unit.

FIG. 3 is a view showing a basic coding tree unit according to anembodiment of the present disclosure.

The largest coding block may be defined as a coding tree block. A singlepicture may be partitioned into a plurality of coding tree units (CTU).A CTU may be a coding unit of the largest size, and may be referred toas the largest coding unit (LCU). FIG. 3 is a view showing an examplewhere a single picture is partitioned into a plurality of CTUs.

A size of a CTU may be defined in a picture level or sequence level. Forthe same, information representing a size of a CTU may be signaledthrough a picture parameter set or sequence parameter set.

In an example, a size of a CTU for the entire picture within a sequencemay be set to 128×128. Alternatively, any one of 128×128 or 256×256 maybe determined as a size of a CTU in a picture level. In an example, aCTU may be set to have a size of 128×128 in a first picture, and a sizeof 256×256 in a second picture.

Coding blocks may be generated by partitioning a CTU. A coding blockrepresents a basic unit for performing encoding/decoding. In an example,prediction or transform may be performed for each coding block, or aprediction encoding mode may be determined for each coding block. Inthis connection, the prediction encoding mode represents a method ofgenerating a prediction image. In an example, a prediction encoding modemay include intra-prediction, inter-prediction, current picturereferencing (CPR), intra block copy (IBC) or combined prediction. For acoding block, a prediction block of the coding block may be generated byusing a prediction encoding mode of at least one of intra-prediction,inter-prediction, current picture referencing, or combined prediction.

Information representing a prediction encoding mode for a current blockmay be signaled in a bitstream. In an example, the information may be a1-bit flag representing whether a prediction encoding mode is an intramode or an inter mode. When a prediction encoding mode for a currentblock is determined as an inter mode, current picture referencing orcombined prediction may be available.

Current picture referencing is setting a current picture as a referencepicture and obtaining a prediction block of a current block from aregion that has been already encoded/decoded within a current picture.In this connection, the current picture means a picture including thecurrent block. Information representing whether or not current picturereferencing is applied to a current block may be signaled in abitstream. In an example, the information may be a 1-bit flag. When theflag is TRUE, a prediction encoding mode for a current block may bedetermined as current picture referencing, and when the flag is FALSE, aprediction encoding mode for a current block may be determined asinter-prediction.

Alternatively, a prediction encoding mode for a current block may bedetermined on the basis of a reference picture index. In an example,when a reference picture index indicates a current picture, a predictionencoding mode for a current block may be determined as current picturereferencing. When a reference picture index indicates a picture otherthan a current picture, a prediction encoding mode for a current blockmay be determined as inter-prediction. In other words, current picturereferencing is a prediction method using information on a region thathas been already encoded/decoded within a current picture, andinter-prediction is a prediction method using information on anotherpicture that has been already encoded/decoded.

Combined prediction represents a combined encoding mode combining atleast two of intra-prediction, inter-prediction, and current picturereferencing. In an example, when combined prediction is applied, a firstprediction block may be generated on the basis of any one ofintra-prediction, inter-prediction or current picture referencing, and asecond prediction block may be generated on the basis of another. When afirst prediction block and a second prediction block are generated, afinal prediction block may be generated by calculating an average orweighted sum of the first prediction block and the second predictionblock. Information representing whether or not to apply combinedprediction to a current block may be signaled in a bitstream. Theinformation may be a 1-bit flag.

FIG. 4 is a view showing various partitioning types a coding block.

A coding block may be partitioned into a plurality of coding blocks onthe basis of quad-tree partitioning, binary-tree partitioning or ternarytree partitioning. The partitioned coding block may be partitioned againinto a plurality of coding blocks on the basis of quad-treepartitioning, binary-tree partitioning or ternary tree partitioning.

Quad-tree partitioning represents a method of partitioning a currentblock into four blocks. As a result of quad-tree partitioning, a currentblock may be partitioned into four square partitions (refer to“SPLIT_QT” of FIG. 4 (a)).

Binary-tree partitioning represents a method of partitioning a currentblock into two blocks. Partitioning a current block into two blocksalong a vertical direction (that is, using a vertical line across thecurrent block) may be referred to vertical directional binary-treepartitioning, and partitioning a current block into two blocks along ahorizontal direction (that is, using a horizontal line across thecurrent block) may be referred to as horizontal directional binary-treepartitioning. As a result of binary-tree partitioning, a current blockmay be partitioned into two non-square partitions. “SPLIT_BT_VER” ofFIG. 4 (b) is a view showing a result of vertical directionalbinary-tree partitioning, and “SPLIT_BT_HOR” of FIG. 4 (c) is a viewshowing a result of horizontal directional binary-tree partitioning.

Ternary-tree partitioning represents a method of partitioning a currentblock into three blocks. Partitioning a current block into three blocksalong a vertical direction (that is, using two vertical lines across thecurrent block) may be referred to vertical directional ternary-treepartitioning, and partitioning a current block into three blocks along ahorizontal direction (that is, using two horizontal lines across thecurrent block) may be referred to as horizontal directional ternary-treepartitioning. As a result of ternary-tree partitioning, a current blockmay be partitioned into three non-square partitions. In this connection,a width/height of a partition positioned at the center of a currentblock may be twice than a width/height of other partitions.“SPLIT_TT_VER” of FIG. 4 (d) is a view showing a result of verticaldirectional ternary-tree partitioning, and “SPLIT_TT_HOR” of FIG. 4 (e)is a view showing a result of horizontal directional ternary-treepartitioning.

The number of partitioning times of a CTU may be defined as apartitioning depth. The maximum partitioning depth of a CTU may bedetermined in a sequence or picture level. Accordingly, the maximumpartitioning depth of a CTU may vary on the basis of a sequence orpicture.

Alternatively, the maximum partitioning depth may be independentlydetermined for each partitioning method. In an example, the maximumpartitioning depth where quad-tree partitioning is allowed may differfrom the maximum partitioning depth where binary-tree partitioningand/or ternary-tree partitioning is allowed.

The encoder may signal information representing at least one of apartitioning type and a partitioning depth of a current block in abitstream. The decoder may determine a partitioning type and apartitioning depth of a CTU on the basis of the information obtained byparsing a bitstream.

FIG. 5 is a view of an example showing an aspect of partitioning a CTU.

Partitioning a coding block by using quad-tree partitioning, binary-treepartitioning and/or ternary-tree partitioning may be referred to asmulti-tree partitioning.

Coding blocks generated by partitioning a coding block by applyingmulti-tree partitioning may be referred to child coding blocks. When apartitioning depth of a coding block is k, a partitioning depth of childcoding blocks is set to k+1.

To the contrary, for coding blocks having a partitioning depth of k+1, acoding block having a partitioning depth of k may be referred to as aparent coding block.

A partitioning type of a current coding block may be determined on thebasis of at least one of a partitioning type of a parent coding blockand a partitioning type of a neighboring coding block. In thisconnection, the neighboring coding block may be a block adjacent to acurrent coding block, and include at least one of an top neighboringblock, a left neighboring block, or a neighboring block adjacent to thetop-left corner of the current coding block. In this connection, thepartitioning type may include whether or not to apply quad-treepartitioning, whether or not to apply binary-tree partitioning, adirection of binary-tree partitioning, whether or not to applyternary-tree partitioning, or a direction of ternary-tree partitioning.

In order to determine a partitioning type of a coding block, informationrepresenting whether or not a coding block is partitioned may besignaled in a bitstream. The information is a 1-bit flag of“split_cu_flag”, and when the flag is TRUE, it may represent that acoding block is partitioned by a multi tree partitioning method.

When split_cu_flag is TRUE, information representing whether or not acoding block is partitioned by quad-tree partitioning may be signaled ina bitstream. The information is a 1-bit flag of split_qt_flag, and whenthe flag is TRUE, a coding block may be partitioned into four blocks.

In an example, in an example shown in FIG. 5, a CTU is partitioned byquad-tree partitioning, and thus four coding blocks having apartitioning depth of 1 are generated. In addition, it is shown thatquad-tree partitioning is applied again to the first coding block andthe fourth coding block among four coding blocks generated by quad-treepartitioning. As a result, four coding blocks having a partitioningdepth of 2 may be generated.

In addition, by applying again quad-tree partitioning to a coding blockhaving a partitioning depth of 2, a coding block having a partitioningdepth of 3 may be generated.

When quad-tree partitioning is not applied to a coding block, whether toperform binary-tree partitioning or ternary-tree partitioning for thecoding block may be determined according to at least one of a size ofthe coding block, whether or not the coding block is positioned at apicture boundary, the maximum partitioning depth, or a partitioning typeof a neighboring block. When it is determined to perform binary-treepartitioning or ternary-tree partitioning for the coding block,information representing a partitioning direction may be signaled in abitstream. The information may be a 1-bit flag ofmtt_split_cu_vertical_flag. Whether a partitioning direction is avertical direction or a horizontal direction may be determined on thebasis of the flag. Additionally, information representing which one ofbinary-tree partitioning or ternary-tree partitioning is applied to thecoding block may be signaled in a bitstream. The information may be a1-bit flag of mtt_split_cu_binary_flag. Whether binary-tree partitioningis applied to the coding block or ternary-tree partitioning is appliedto the coding block may be determined on the basis of the flag.

In an example, in an example shown in FIG. 5, vertical directionalbinary-tree partitioning is applied to a coding block having apartitioning depth of 1, vertical directional ternary-tree partitioningis applied to a left coding block among coding blocks generated by thepartitioning, and vertical directional binary-tree partitioning isapplied to a right coding block.

Inter-prediction is a prediction encoding mode predicting a currentblock by using information on a previous picture. In an example, a block(hereinafter, collocated block) at the same position with a currentblock within a previous picture may be set as a prediction block of thecurrent block. Hereinafter, a prediction block generated on the basis ofa collocated block of the current block may be referred to as acollocated prediction block.

To the contrary, when an object present in a previous picture has movedto another position in a current picture, a current block may beeffectively predicted by using motions of the object. For example, whena motion direction and a size of the object is determined by comparing aprevious picture with a current picture, a prediction block (orprediction image) of the current block may be generated according tomotion information of the objects. Hereinafter, a prediction blockgenerated by using motion information may be referred to as a motionprediction block.

A residual block may be generated by subtracting a prediction block froma current block. In this connection, in case where an object moves,energy of a residual block may be reduced by using a motion predictionblock rather than using a collocated prediction block, and thuscompression performance of the residual block may be improved.

As above, generating a prediction block by using motion information maybe referred to as motion estimation prediction. In the mostinter-prediction, a prediction block may be generated on the basis ofmotion compensation prediction.

Motion information may include at least one of a motion vector, areference picture index, a prediction direction, and a bidirectionalweighting factor index. A motion vector represents a motion direction ofan object and a magnitude. A reference picture index specifies areference picture of a current block among reference pictures includedin a reference picture list. A prediction direction indicates any one ofuni-directional L0 prediction, uni-directional L1 prediction, orbi-directional prediction (L0 prediction and L1 prediction). At leastone of L0 directional motion information and L1 directional motioninformation may be used according to a prediction direction of a currentblock. A bidirectional weighting factor index specifies a weightingfactor applied to an L0 prediction block and a weighting factor appliedto an L1 prediction block.

FIG. 6 is a flow diagram of an inter-prediction method according to theembodiment of the present disclosure.

In reference to FIG. 6, an inter-prediction method includes determiningan inter-prediction mode for a current block (S601), obtaining motioninformation of the current block according to the determinedinter-prediction mode (S602), and performing motion compensationprediction for a current block on the basis of the obtained motioninformation (S603).

In this connection, the inter-prediction mode may represent variousmethods for determining motion information of a current block, andinclude an inter-prediction mode using translation motion information,an inter-prediction mode using affine motion information. In an example,an inter-prediction mode using translation motion information mayinclude a merge mode and a motion vector prediction mode, and aninter-prediction mode using affine motion information may include anaffine merge mode and an affine motion vector prediction mode. Motioninformation on a current block may be determined on the basis of aneighboring block neighboring the current block or information obtainedby parsing a bitstream.

Motion information of a current block may be derived from motioninformation of another block. In this connection, another block may be ablock encoded/decoded by inter prediction previous to the current block.Setting motion information of a current block to be the same as motioninformation of another block may be defined as a merge mode. Also,setting a motion vector of another block as a prediction value of amotion vector of the current block may be defined as a motion vectorprediction mode.

FIG. 7 is a flow diagram of a process deriving the motion information ofa current block under a merge mode.

The merge candidate of a current block may be derived (S701). The mergecandidate of a current block may be derived from a block encoded/decodedby inter-prediction prior to a current block.

FIG. 8 is a diagram illustrating candidate blocks used to derive a mergecandidate.

The candidate blocks may include at least one of neighboring blocksincluding a sample adjacent to a current block or non-neighboring blocksincluding a sample non-adjacent to a current block. Hereinafter, samplesdetermining candidate blocks are defined as base samples. In addition, abase sample adjacent to a current block is referred to as a neighboringbase sample and a base sample non-adjacent to a current block isreferred to as a non-neighboring base sample.

A neighboring base sample may be included in a neighboring column of aleftmost column of a current block or a neighboring row of an uppermostrow of a current block. In an example, when the coordinate of a left-topsample of a current block is (0,0), at least one of a block including abase sample at a position of (−1, H−1), (W−1, −1), (W, −1), (−1, H) or(−1, 1) may be used as a candidate block. In reference to a diagram, theneighboring blocks of index 0 to 4 may be used as candidate blocks.

A non-neighboring base sample represents a sample that at least one of ax-axis distance or a y-axis distance with a base sample adjacent to acurrent block has a predefined value. In an example, at least one of ablock including a base sample that a x-axis distance with a left basesample is a predefined value, a block including a non-neighboring samplethat a y-axis distance with a top base sample is a predefined value or ablock including a non-neighboring sample that a x-axis distance and ay-axis distance with a left-top base sample are a predefined value maybe used as a candidate block. A predefined value may be a natural numbersuch as 4, 8, 12, 16, etc. In reference to a diagram, at least one ofblocks in an index 5 to 26 may be used as a candidate block.

Alternatively, a candidate block not belonging to the same coding treeunit as a current block may be set to be unavailable as a mergecandidate. In an example, when a base sample is out of an upper boundaryof a coding tree unit to which a current block belongs, a candidateblock including the base sample may be set to be unavailable as a mergecandidate.

A merge candidate may be derived from a temporal neighboring blockincluded in a picture different from a current block. In an example, amerge candidate may be derived from a collocated block included in acollocated picture. Any one of reference pictures included in areference picture list may be set as a collocated picture. Indexinformation identifying a collocated picture among reference picturesmay be signaled in a bitstream. Alternatively, a reference picture witha predefined index among reference pictures may be determined as acollocated picture.

The motion information of a merge candidate may be set the same as themotion information of a candidate block. In an example, at least one ofa motion vector, a reference picture index, a prediction direction or abidirectional weight index of a candidate block may be set as the motioninformation of a merge candidate.

A merge candidate list including a merge candidate may be generatedS702.

The index of merge candidates in a merge candidate list may be assignedaccording to the predetermined order. In an example, an index may beassigned in the order of a merge candidate derived from a leftneighboring block, a merge candidate derived from a top neighboringblock, a merge candidate derived from a right-top neighboring block, amerge candidate derived from a left-bottom neighboring block, a mergecandidate derived from a left-top neighboring block and a mergecandidate derived from a temporal neighboring block.

When a plurality of merge candidates are included in a merge candidate,at least one of a plurality of merge candidates may be selected S703.Concretely, information for specifying any one of a plurality of mergecandidates may be signaled in a bitstream. In an example, information,merge idx, representing an index of any one of merge candidates includedin a merge candidate list may be signaled in a bitstream.

A motion vector may be derived per sub-block.

FIG. 9 is a diagram to explain an example of determining a motion vectorper sub-block.

Any motion vector among a plurality of merge candidates included in amerge candidate list may be set as an initial motion vector of a currentblock. In this connection, a merge candidate used to derive the initialmotion vector may be determined by a syntax, merge idx. Alternatively,when neighboring blocks adjacent to the current block are searched inthe predetermined scanning order, the initial motion vector may bederived from an available merge candidate which was found first. In thisconnection, the predetermined scanning order may be the order of aneighboring block (A1) adjacent to the left of the current block, aneighboring block (B1) adjacent to the top of the current block, aneighboring block (B0) adjacent to the right-top corner of the currentblock and a neighboring block (A0) adjacent to the left-bottom corner ofthe current block. Alternatively, the predetermined scanning order maybe defined in the order of B1, B0, A1 and A0 or may be determined in theorder of B1, A1, B0 and A0.

If an initial motion vector is determined, a collocated picture of acurrent block may be determined. In this connection, the collocatedpicture may be set as a reference picture having a predefined indexamong reference pictures included in a reference picture list. Forexample, a predefined index may be 0 or the largest index.Alternatively, information for determining the collocated picture may besignaled in a bitstream. In an example, a syntax, collocated_ref_idx,specifying a collocated picture in a reference picture list may besignaled in a bitstream.

If a collocated picture is determined, a block apart from a collocatedblock with the same position and size as a current block in thecollocated picture by an initial motion vector may be determined. Theblock specified by an initial motion vector may be referred to as acollocated picture corresponding block. In an example, when an initialmotion vector (for FIG. 9, the motion vector of A1 block) is (x1, y1), ablock far apart from a block at the same position as the current blockin the collocated picture (i.e., the collocated block) by (x1, y1) maybe determined as a collocated picture corresponding block.

If a collocated picture corresponding block is determined, motionvectors of sub-blocks in the collocated picture corresponding block maybe set as motion vectors of sub-blocks in a current block. In anexample, when a current block is partitioned into 4×4 sized sub-blocks,a motion vector for 4×4 sized sub-blocks in the collocated picturecorresponding block may be set as a motion vector of each sub-block inthe current block.

When a sub-block in a collocated picture corresponding block has abidirectional motion vector (e.g. L0 motion vector and L1 motionvector), the bidirectional motion vector of a sub-block in thecollocated picture corresponding block may be taken as the bidirectionalmotion vector of a sub-block in a current block. Alternatively, based onwhether a bidirectional prediction is applied to a current block, onlyL0 motion vector may be taken or only L1 motion vector may be taken froma sub-block in the collocated picture corresponding block.

Alternatively, when a reference picture of a current block is differentfrom a reference picture of a collocated picture corresponding block,the motion vector of a sub-block in the collocated picture correspondingblock may be scaled to derive the motion vector of a sub-block in thecurrent block.

The reference picture of the current block and whether a bidirectionalprediction is applied to the current block may be set the same as amerge candidate used to derive an initial motion vector. Alternatively,information for specifying the reference picture of the current blockand/or information indicating whether a bidirectional prediction isapplied to a current block may be signaled in a bitstream.

Information indicating whether a motion vector will be derived persub-block may be signaled in a bitstream. The information may be a 1-bitflag, but it is not limited thereto. Alternatively, based on whether abidirectional prediction is applied to a current block or at least oneof the number of available merge candidates, whether a motion vectorwill be derived per sub-block may be determined.

When the number of merge candidates included in a merge candidate listis less than the threshold, a motion information candidate included in amotion information table may be added to a merge candidate list as amerge candidate. In this connection, the threshold may be the maximumnumber of merge candidates which may be included in a merge candidatelist or a value in which an offset is subtracted from the maximum numberof merge candidates. An offset may be a natural number such as 1 or 2,etc.

A motion information table includes a motion information candidatederived from a block encoded/decoded based on inter-prediction in acurrent picture. In an example, the motion information of a motioninformation candidate included in a motion information table may be setthe same as the motion information of a block encoded/decoded based oninter-prediction. In this connection, motion information may include atleast one of a motion vector, a reference picture index, a predictiondirection or a bidirectional weight index.

A motion information candidate included in a motion information tablealso can be referred to as a inter region merge candidate or aprediction region merge candidate.

The maximum number of a motion information candidate which may beincluded in a motion information table may be predefined in an encoderand a decoder. In an example, the maximum number of a motion informationcandidate which may be included in a motion information table may be 1,2, 3, 4, 5, 6, 7, 8 or more (e.g. 16).

Alternatively, information representing the maximum number of a motioninformation candidate which may be included in a motion informationtable may be signaled in a bitstream. The information may be signaled ina sequence, a picture or a slice level. The information may representthe maximum number of a motion information candidate which may beincluded in a motion information table. Alternatively, the informationmay represent difference between the maximum number of a motioninformation candidate which may be included in a motion informationtable and the maximum number of a merge candidate which may be includedin a merge candidate list.

Alternatively, the maximum number of a motion information candidatewhich may be included in a motion information table may be determinedaccording to a picture size, a slice size or a coding tree unit size.

A motion information table may be initialized in a unit of a picture, aslice, a tile, a brick, a coding tree unit or a coding tree unit line (arow or a column). In an example, when a slice is initialized, a motioninformation table is also initialized thus a motion information tablemay not include any motion information candidate.

Alternatively, information representing whether a motion informationtable will be initialized may be signaled in a bitstream. Theinformation may be signaled in a slice, a tile, a brick or a blocklevel. Until the information indicates the initialization of a motioninformation table, a pre-configured motion information table may beused.

Alternatively, information on an initial motion information candidatemay be signaled in a picture parameter set or a slice header. Although aslice is initialized, a motion information table may include an initialmotion information candidate. Accordingly, an initial motion informationcandidate may be used for a block which is the first encoding/decodingtarget in a slice.

Alternatively, a motion information candidate included in the motioninformation table of a previous coding tree unit may be set as aninitial motion information candidate. In an example, a motioninformation candidate with the smallest index or with the largest indexamong motion information candidates included in the motion informationtable of a previous coding tree unit may be set as an initial motioninformation candidate.

Blocks are encoded/decoded in the order of encoding/decoding, and blocksencoded/decoded based on inter-prediction may be sequentially set as amotion information candidate in the order of encoding/decoding.

FIG. 10 is a diagram to explain the update aspect of a motioninformation table.

For a current block, when inter-prediction is performed S1001, a motioninformation candidate may be derived based on a current block S1002. Themotion information of a motion information candidate may be set the sameas that of a current block.

When a motion information table is empty S1003, a motion informationcandidate derived based on a current block may be added to a motioninformation table S1004.

When a motion information table already includes a motion informationcandidate S1003, a redundancy check for the motion information of acurrent block (or, a motion information candidate derived based on it)may be performed S1005. A redundancy check is to determine whether themotion information of a pre-stored motion information candidate in amotion information table is the same as the motion information of acurrent block. A redundancy check may be performed for all pre-storedmotion information candidates in a motion information table.

Alternatively, a redundancy check may be performed for motioninformation candidates with an index over or below the threshold amongpre-stored motion information candidates in a motion information table.Alternatively, a redundancy check may be performed for the predefinednumber of motion information candidates. In an example, 2 motioninformation candidates with smallest indexes or with largest indexes maybe determined as targets for a redundancy check.

When a motion information candidate with the same motion information asa current block is not included, a motion information candidate derivedbased on a current block may be added to a motion information tableS1008. Whether motion information candidates are identical may bedetermined based on whether the motion information (e.g. a motionvector/a reference picture index, etc.) of motion information candidatesis identical.

In this connection, when the maximum number of motion informationcandidates are already stored in a motion information table S1006, theoldest motion information candidate may be deleted S1007 and a motioninformation candidate derived based on a current block may be added to amotion information table S1008. In this connection, the oldest motioninformation candidate may be a motion information candidate with thelargest or the smallest index.

Motion information candidates may be identified by respective index.When a motion information candidate derived from a current block isadded to a motion information table, the smallest index (e.g. 0) may beassigned to the motion information candidate and indexes of pre-storedmotion information candidates may be increased by 1. In this connection,When the maximum number of motion information candidates are alreadystored in a motion information table, a motion information candidatewith the largest index is removed.

Alternatively, when a motion information candidate derived from acurrent block is added to a motion information table, the largest indexmay be assigned to the motion information candidate. In an example, whenthe number of pre-stored motion information candidates in a motioninformation table is less than the maximum value, an index with the samevalue as the number of pre-stored motion information candidates may beassigned to the motion information candidate. Alternatively, when thenumber of pre-stored motion information candidates in a motioninformation table is equal to the maximum value, an index subtracting 1from the maximum value may be assigned to the motion informationcandidate. Alternatively, a motion information candidate with thesmallest index is removed and the indexes of residual pre-stored motioninformation candidates are decreased by 1.

FIG. 11 is a diagram showing the update aspect of a motion informationtable.

It is assumed that as a motion information candidate derived from acurrent block is added to a motion information table, the largest indexis assigned to the motion information candidate. In addition, it isassumed that the maximum number of a motion information candidate isalready stored in a motion information table.

When a motion information candidate HmvpCand[n+1] derived from a currentblock is added to a motion information table HmvpCandList, a motioninformation candidate HmvpCand[0] with the smallest index amongpre-stored motion information candidates may be deleted and indexes ofresidual motion information candidates may be decreased by 1. Inaddition, the index of a motion information candidate HmvpCand[n+1]derived from a current block may be set to the maximum value (for anexample shown in FIG. 11, n).

When a motion information candidate identical to a motion informationcandidate derived based on a current block is prestored S1005, a motioninformation candidate derived based on a current block may not be addedto a motion information table S1009.

Alternatively, while a motion information candidate derived based on acurrent block is added to a motion information table, a pre-storedmotion information candidate identical to the motion informationcandidate may be removed. In this case, it causes the same effect aswhen the index of a pre-stored motion information candidate is newlyupdated.

FIG. 12 is a diagram showing an example in which the index of apre-stored motion information candidate is updated.

When the index of a pre-stored motion information candidate identical toa motion information candidate mvCand derived from a current block ishIdx, the pre-stored motion information candidate may be removed and theindex of motion information candidates with an index larger than hIdxmay be decreased by 1. In an example, an example shown in FIG. 12 showedthat HmvpCand[2] identical to mvCand is deleted in a motion informationtable HvmpCandList and an index from HmvpCand[3] to HmvpCand[n] isdecreased by 1.

And, a motion information candidate mvCand derived based on a currentblock may be added to the end of a motion information table.

Alternatively, an index assigned to a pre-stored motion informationcandidate identical to a motion information candidate derived based on acurrent block may be updated. For example, the index of a pre-storedmotion information candidate may be changed to the minimum value or themaximum value.

The motion information of blocks included in a predetermined region maybe set not to be added to a motion information table. In an example, amotion information candidate derived based on the motion information ofa block included in a merge processing region may not be added to amotion information table. Since the encoding/decoding order for blocksincluded in a merge processing region is not defined, it is improper touse motion information of any one of them for the inter-prediction ofanother of them. Accordingly, motion information candidates derivedbased on blocks included in a merge processing region may not be addedto a motion information table.

Alternatively, the motion information of a block smaller than a presetsize may be set not to be added to a motion information table. In anexample, a motion information candidate derived based on the motioninformation of a coding block whose width or height is smaller than 4 or8 or the motion information of a 4×4 sized coding block may not be addedto a motion information table.

When motion compensation prediction is performed per sub-block basis, amotion information candidate may be derived based on the motioninformation of a representative sub-block among a plurality ofsub-blocks included in a current block. In an example, when a sub-blockmerge candidate is used for a current block, a motion informationcandidate may be derived based on the motion information of arepresentative sub-block among sub-blocks.

The motion vector of sub-blocks may be derived in the following order.First, any one of merge candidates included in the mere candidate listof a current block may be selected and an initial shift vector(shVector) may be derived based on the motion vector of a selected mergecandidate. And, a shift sub-block that a base sample is at a position of(xColSb, yColSb) may be derived by adding an initial shift vector to theposition (xSb, ySb) of the base sample of each sub-block in a codingblock (e.g. a left-top sample or a center sample). The below Equation 1shows a formula for deriving a shift sub-block.

(xColSb,yColSb)=(xSb+shVector[0]>>4,ySb+shVector[1]>>4)  [Equation 1]

Then, the motion vector of a collocated block corresponding to thecenter position of a sub-block including (xColSb, yColSb) may be set asthe motion vector of a sub-block including (xSb, ySb).

A representative sub-block may mean a sub-block including the left-topsample or center sample of a current block.

FIG. 13 is a diagram showing the position of a representative sub-block.

FIG. 13 (a) shows an example in which a sub-block positioned at theleft-top of a current block is set as a representative sub-block andFIG. 12 (b) shows an example in which a sub-block positioned at thecenter of a current block is set as a representative sub-block. Whenmotion compensation prediction is performed in a basis of a sub-block,the motion information candidate of a current block may be derived basedon the motion vector of a sub-block including the left-top sample of acurrent block or including the central sample of a current block.

Based on the inter-prediction mode of a current block, it may bedetermined whether a current block will be used as a motion informationcandidate. In an example, a block encoded/decoded based on an affinemotion model may be set to be unavailable as a motion informationcandidate. Accordingly, although a current block is encoded/decoded byinter-prediction, a motion information table may not be updated based ona current block when the inter-prediction mode of a current block is anaffine prediction mode.

Alternatively, a motion information candidate may be derived based on atleast one sub-block vector of a sub-block included in a blockencoded/decoded based on an affine motion model. In an example, a motioninformation candidate may be derived by using a sub-block positioned atthe left-top, the center or the right-top of a current block.Alternatively, the average value of the sub-block vectors of a pluralityof sub-blocks may be set as the motion vector of a motion informationcandidate.

Alternatively, a motion information candidate may be derived based onthe average value of the affine seed vectors of a block encoded/decodedbased on an affine motion model. In an example, at least one average ofthe first affine seed vector, the second affine seed vector or the thirdaffine seed vector of a current block may be set as the motion vector ofa motion information candidate.

Alternatively, a motion information table may be configured perinter-prediction mode. In an example, at least one of a motioninformation table for a block encoded/decoded by an intra block copy, amotion information table for a block encoded/decoded based on atranslation motion model or a motion information table for a blockencoded/decoded based on an affine motion model may be defined.According to the inter-prediction mode of a current block, any one of aplurality of motion information tables may be selected.

FIG. 14 shows an example in which a motion information table isgenerated per inter-prediction mode.

When a block is encoded/decoded based on a non-affine motion model, amotion information candidate mvCand derived based on the above block maybe added to a non-affine motion information table HmvpCandList.

A motion information candidate may be set to include additionalinformation except for motion information. In an example, at least oneof the size, shape or partition information of a block may beadditionally stored in a motion information candidate. When the mergecandidate list of a current block is configured, only motion informationcandidate whose size, shape or partition information is identical orsimilar to a current block among motion information candidates may beused or a motion information candidate whose size, shape or partitioninformation is identical or similar to a current block may be added to amerge candidate list in advance.

When the number of a merge candidate included in the merge candidatelist of a current block is less than the threshold, a motion informationcandidate included in a motion information table may be added to a mergecandidate list as a merge candidate. The additional process is performedin the order reflecting sorted order of indexes of motion informationcandidates in ascending or descending order. In an example, a motioninformation candidate with the largest index may be first added to themerge candidate list of a current block.

When a motion information candidate included in a motion informationtable is added to a merge candidate list, a redundancy check between amotion information candidate and pre-stored merge candidates in themerge candidate list may be performed. As a result of a redundancycheck, a motion information candidate with the same motion informationas a pre-stored merge candidate may not be added to the merge candidatelist.

A redundancy check may be performed only for a part of motioninformation candidates included in a motion information table. In anexample, a redundancy check may be performed only for a motioninformation candidate with an index over or below the threshold.Alternatively, a redundancy check may be performed only for N motioninformation candidates with the largest index or the smallest index.

Alternatively, a redundancy check may be performed only for a part ofpre-stored merge candidates in a merge candidate list. In an example, aredundancy check may be performed only for a merge candidate whose indexis over or below the threshold or a merge candidate derived from a blockat a specific position. In this connection, a specific position mayinclude at least one of the left neighboring block, the top neighboringblock, the right-top neighboring block or the left-bottom neighboringblock of a current block.

FIG. 15 is a diagram showing an example in which a redundancy check isperformed only for a part of merge candidates.

When a motion information candidate HmvpCand[j] is added to a mergecandidate list, a redundancy check with 2 merge candidates with thelargest index, mergeCandList[NumMerge−2] and mergeCandList[NumMerge−1],may be performed for a motion information candidate. In this connection,NumMerge may show the number of an available spatial merge candidate anda temporal merge candidate.

Unlike a shown example, when a motion information candidate HmvpCand[j]is added to a merge candidate list, a redundancy check with 2 mergecandidates with the smallest index may be performed for a motioninformation candidate. For example, it may be checked whethermergeCandList[0] and mergeCandList[1] are identical to HmvpCand[j].

Alternatively, a redundancy check may be performed only for a mergecandidate derived from a specific position. In an example, a redundancycheck may be performed for at least one of a merge candidate derivedfrom a neighboring block positioned at the left of a current block or atthe top of a current block. When there is no merge candidate derivedfrom a specific position in a merge candidate list, a motion informationcandidate may be added to a merge candidate list without a redundancycheck.

When a motion information candidate HmvpCand[j] is added to a mergecandidate list, a redundancy check with 2 merge candidates with thelargest index, mergeCandList[NumMerge−2] and mergeCandList[NumMerge−1],may be performed for a motion information candidate. In this connection,NumMerge may show the number of an available spatial merge candidate anda temporal merge candidate.

A redundancy check with a merge candidate may be performed only for apart of motion information candidates. In an example, a redundancy checkmay be performed only for N motion information candidates with a largeor a small index among motion information candidates included in amotion information table. In an example, a redundancy check may beperformed only for motion information candidates with an index that thenumber and difference of motion information candidates included in amotion information table are below the threshold. When the threshold is2, a redundancy check may be performed only for 3 motion informationcandidates with the largest index value among motion informationcandidates included in a motion information table. A redundancy checkmay be omitted for motion information candidates except for the above 3motion information candidates. When a redundancy check is omitted, amotion information candidate may be added to a merge candidate listregardless of whether the same motion information as a merge candidateis exist or not.

Conversely, a redundancy check is set to be performed only for motioninformation candidates with an index that the number and difference ofmotion information candidates included in a motion information table areover the threshold.

The number of a motion information candidate that a redundancy check isperformed may be redefined in an encoder and a decoder. In an example,the threshold may be an integer such as 0, 1 or 2.

Alternatively, the threshold may be determined based on at least one ofthe number of a merge candidate included in a merge candidate list orthe number of motion information candidates included in a motioninformation table.

When a merge candidate identical to the first motion informationcandidate is found, a redundancy check with the merge candidateidentical to the first motion information candidate may be omitted in aredundancy check for the second motion information candidate.

FIG. 16 is a diagram showing an example in which a redundancy check witha specific merge candidate is omitted.

When a motion information candidate HmvpCand[i] whose index is i isadded to a merge candidate list, a redundancy check between the motioninformation candidate and pre-stored merge candidates in a mergecandidate list is performed. In this connection, when a merge candidatemergeCandlist[j] identical to a motion information candidate HmvpCand[i]is found, a redundancy check between a motion information candidateHmvpCand[i−1] whose index is i−1 and merge candidates may be performedwithout adding the motion information candidate HmvpCand[i] to a mergecandidate list. In this connection, a redundancy check between themotion information candidate HmvpCand[i−1] and the merge candidatemergeCandList[j] may be omitted.

In an example, in an example shown in FIG. 16, it was determined thatHmvpCand[i] and mergeCandList[2] are identical. Accordingly, aredundancy check for HmvpCand[i−1] may be performed without addingHmvpCand[i] to a merge candidate list. In this connection, a redundancycheck between HmvpCand[i−1] and mergeCandList[2] may be omitted.

When the number of a merge candidate included in the merge candidatelist of a current block is less than the threshold, at least one of apairwise merge candidate or a zero merge candidate may be additionallyincluded except for a motion information candidate. A pairwise mergecandidate means a merge candidate having a value obtained from averagingthe motion vectors of more than 2 merge candidates as a motion vectorand a zero merge candidate means a merge candidate whose motion vectoris 0.

For the merge candidate list of a current block, a merge candidate maybe added in the following order.

Spatial merge candidate-Temporal merge candidate-Motion informationcandidate-(Affine motion information candidate)-Pairwise mergecandidate-Zero merge candidate

A spatial merge candidate means a merge candidate derived from at leastone of a neighboring block or a non-neighboring block and a temporalmerge candidate means a merge candidate derived from a previousreference picture. An affine motion information candidate represents amotion information candidate derived from a block encoded/decoded by anaffine motion model.

Intra-prediction predicts a current block by using a reconstructedsample that has been already encoded/decoded and which is around thecurrent block. In this connection, a reconstructed sample beforeapplying an in-loop filter may be used for intra-prediction of thecurrent block.

An intra-prediction method includes intra-prediction based on a matrixand intra-prediction according to a direction with a neighboringreconstruction sample. Information indicating an intra-prediction methodof a current block may be signaled in a bitstream. The information maybe a 1-bit flag. Alternatively, an intra-prediction of a current blockmay be determined on the basis of at least one of a position of thecurrent block, a size of the current block, a shape of the currentblock, or an intra-prediction method of a neighboring block. In anexample, when a current block is present crossing a picture boundary, itmay be set such that an intra-prediction method based on a matrix is notapplied to the current block.

An intra-prediction method based on a matrix is a method of obtaining aprediction block of a current block on the basis of a matrix product ofa matrix stored in the encoder and the decoder, and reconstructionsamples around the current block. Information for specifying any one ofa plurality of prestored matrices may be signaled in a bitstream. Thedecoder may determine a matrix for performing intra-prediction on acurrent block on the basis of the above information and a size of thecurrent block.

General intra-prediction is a method of obtaining a prediction block ofa current block on the basis of a non-directional intra-prediction modeor directional intra-prediction mode. Hereinafter, with reference tofigures, a process of intra-prediction based on general intra-predictionwill be described in detail.

FIG. 17 is a flow diagram of an intra-prediction method according to anembodiment of the present disclosure.

A reference sample line of a current block may be determined S1701. Thereference sample line means a group of reference samples included in ak-th line apart from a top and/or a left of the current block. Areference sample may be derived from a reconstructed sampleencoded/decoded around the current block.

Index information identifying a reference sample line for a currentblock among a plurality of reference sample lines may be signaled in abitstream. In an example, index information, intra_luma_ref_idx, forspecifying the reference sample line of the current block may besignaled in the bitstream. The index information may be signaled percoding block.

A plurality of reference sample lines may include at least one of afirst line, a second line or a third line at a top and/or left of acurrent block. A reference sample line composed of a row adjacent to thetop of the current block and a column adjacent to the left of thecurrent block among a plurality of reference sample lines may bereferred to as an adjacent reference sample line, and other referencesample lines may be referred to as a non-adjacent reference sample line.

Table 1 shows an index assigned to each candidate reference sample line.

TABLE 1 Index (intra_luma_ref_idx) Reference sample line 0 Adjacentreference sample line 1 First non-adjacent reference sample line 2Second non-adjacent reference sample line

Based on at least one of a position, a size, a shape of a current blockor a prediction encoding mode of a neighboring block, a reference sampleline of the current block may be determined. In one example, when thecurrent block adjoins a boundary of a picture, a tile, a slice or acoding tree unit, an adjacent reference sample line may be determined asthe reference sample line of the current block.

A reference sample line may include top reference samples positioned ata top of the current block and left reference samples positioned at aleft of the current block. The top reference samples and left referencesamples may be derived from reconstructed samples around the currentblock. The reconstructed samples may be in a state before an in-loopfilter is applied.e

Next, an intra-prediction mode of a current block may be determinedS1702. For the intra-prediction mode of the current block, at least oneof a non-directional intra-prediction mode or a directionalintra-prediction mode may be determined as the intra-prediction mode ofthe current block. Non-directional intra-prediction modes includes aplanar and a DC and directional intra-prediction modes includes 33 or 65modes from a left-bottom diagonal direction to a right-top diagonaldirection.

FIG. 18 is a diagram showing intra-prediction modes.

FIG. 18 (a) shows 35 intra-prediction modes and FIG. 18 (b) shows 67intra-prediction modes.

The larger or smaller number of intra-prediction modes than shown inFIG. 18 may be defined.

Based on an intra-prediction mode of a neighboring block adjacent to acurrent block, an MPM (Most Probable Mode) may be set. In thisconnection, a neighboring block may include a left neighboring blockadjacent to a left of the current block and a top neighboring blockadjacent to a top of the current block.

The number of MPMs included in an MPM list may be preset in an encoderand a decoder. In an example, the number of MPMs may be 3, 4, 5 or 6.Alternatively, information representing the number of MPMs may besignaled in a bitstream. Alternatively, based on at least one of aprediction encoding mode of a neighboring block, a size, a shape or areference sample line index of a current block, the number of MPMs maybe determined. In an example, while N MPMs may be used when an adjacentreference sample line is determined as the reference sample line of thecurrent block, M MPMs may be used when a non-adjacent reference sampleline is determined as the reference sample line of the current block. AsM is a natural number smaller than N, in an example, N may be 6 and Mmay be 5, 4 or 3. Accordingly, while the intra-prediction mode of thecurrent block may be determined as any one of 6 candidateintra-prediction modes when the index of the reference sample line ofthe current block is 0 and an MPM flag is true, the intra-predictionmode of the current block may be determined as any one of 5 candidateintra-prediction modes when the index of the reference sample line ofthe current block is larger than 0 and an MPM flag is true.

Alternatively, the fixed number (e.g. 6 or 5) of MPM candidates may beused regardless of the index of the reference sample line of the currentblock.

An MPM list including a plurality of MPMs may be generated andinformation indicating whether the same MPM as an intra-prediction modeof a current block is included in the MPM list may be signaled in abitstream. As the information is a 1-bit flag, it may be referred to asan MPM flag. When the MPM flag represents the same MPM as the currentblock is included in the MPM list, index information identifying one ofMPMs may be signaled in a bitstream. In an example, index information,mpm_idx, specifying any one of plural MPMs may be signaled in abitstream. An MPM specified by the index information may be set as theintra-prediction mode of the current block. When the MPM flag representsthe same MPM as the current block is not included in the MPM list,remaining mode information indicating any one of remainingintra-prediction modes except for MPMs may be signaled in a bitstream.Remaining mode information represents an index value corresponding tothe intra-prediction mode of the current block when an index isreassigned to remaining intra-prediction modes except for MPMs. Adecoder may may determine the intra-prediction mode of the current blockby arranging MPMs in the ascending order and comparing remaining modeinformation with MPMs. In an example, when remaining mode information isequal to or smaller than MPM, the intra-prediction mode of the currentblock may be derived by adding 1 to remaining mode information.

In deriving an intra-prediction mode of a current block, comparing apart of MPMs with remaining mode information may be omitted. In anexample, MPMs in a non-directional intra-prediction mode among MPMs maybe excluded from a comparison target. When non-directionalintra-prediction modes are set as MPMs, remaining mode informationclearly indicates a directional intra-prediction mode, so theintra-prediction mode of the current block may be derived by comparingremaining MPMs except for non-directional intra-prediction modes withremaining mode information. Instead of excluding non-directionalintra-prediction modes from a comparison target, a result value may becompared with remaining MPMs after adding the number of non-directionalintra-prediction modes to remaining mode information.

Instead of setting a default mode as an MPM, information indicatingwhether an intra-prediction mode of a current block is the default modemay be signaled in a bitstream. The information is a 1-bit flag and theflag may be referred to as a default mode flag. The default mode flagmay be signaled only when an MPM flag represents that the same MPM asthe current block is included in an MPM list. As described above, thedefault mode may include at least one of a planar, DC, a verticaldirection mode or a horizontal direction mode. In an example, when theplanar is set as the default mode, the default mode flag may indicatewhether the intra-prediction mode of the current block is the planar.When the default mode flag indicates that the intra-prediction mode ofthe current block is not the default mode, one of MPMs indicated byindex information may be set as the intra-prediction mode of the currentblock.

When a default mode flag is used, it may be set that an intra-predictionmode same with a default mode is not set as an MPM. In an example, whenthe default mode flag indicates that whether the intra-prediction modeof the current block is a planar, the intra-prediction mode of thecurrent block may be derived by using 5 MPMs excluding an MPMcorresponding to the planar.

When a plurality of intra-prediction modes are set as default modes,index information indicating any one of default modes may be furthersignaled. The intra-prediction mode of the current block may be set as adefault mode indicated by the index information.

When an index of a reference sample line of a current block is not 0, itmay be set not to use a default mode. In an example, when a non-adjacentreference sample line is determined as the reference sample line of thecurrent block, it may be set not to use a non-directionalintra-prediction mode such as a DC mode or a planar mode. Accordingly,when an index of a reference sample line is not 0, a default mode flagmay not be signaled and a value of the default mode flag may be inferredto a predefined value (i.e. false).

When an intra-prediction mode of a current block is determined,prediction samples for the current block may be obtained based on adetermined intra-prediction mode S1703.

When the DC mode is selected, prediction samples for the current blockmay be generated based on an average value of the reference samples. Indetail, values of all of samples within the prediction block may begenerated based on an average value of the reference samples. An averagevalue may be derived using at least one of top reference samplesadjacent to the top of the current block, and left reference samplesadjacent to the left of the current block.

The number or a range of the reference samples used when deriving anaverage value may vary based on the shape of the current block. In anexample, when a current block is a non-square block where a width isgreater than a height, an average value may be calculated by using topreference samples. To the contrary, when a current block is a non-squareblock where a width is smaller than a height, an average value may becalculated by using left reference samples. In other words, when a widthand a height of the current block are different, reference samplesadjacent to the greater length may be used so as to calculate an averagevalue. Alternatively, whether to calculate an average value by using topreference samples or by using left reference samples may be determinedon the basis of a ratio between a width and a height of the currentblock.

When a planar mode is selected, a prediction sample may be obtained byusing a horizontal directional prediction sample and a verticaldirectional prediction sample. In this connection, the horizontaldirectional prediction sample may be obtained on the basis of a leftreference sample and a right reference sample which are positioned atthe same horizontal line with the prediction sample, and the verticaldirectional prediction sample may be obtained on the basis of an topreference sample and a bottom reference sample which are positioned atthe same vertical line with the prediction sample. In this connection,the right reference sample may be generated by copying a referencesample adjacent to the top-right corner of the current block, and thebottom reference sample may be generated by copying a reference sampleadjacent to the lower-left corner of the current block. The horizontaldirectional prediction sample may be obtained on the basis of a weightedsum of the left reference sample and the right reference sample, and thevertical directional prediction sample may be obtained on the basis of aweighted sum of the top reference sample and the bottom referencesample. In this connection, a weighting factor assigned to eachreference sample may be determined according to a position of theprediction sample. The prediction sample may be obtained on the basis ofan average or a weighted sum of the horizontal directional predictionsample and the vertical directional prediction sample. When a weightedsum is used, a weighting factor assigned to the horizontal directionalprediction sample and the vertical directional prediction sample may bedetermined on the basis of a position of the prediction sample.

When a directional prediction mode is selected, a parameter representinga prediction direction (or prediction angle) of the selected directionalprediction mode may be determined. Table 2 below represents an intradirectional parameter of intraPredAng for each intra-prediction mode.

TABLE 2 PredModeIntra 1 2 3 4 5 6 7 IntraPredAng — 32 26 21 17 13 9PredModeIntra 8 9 10 11 12 13 14 IntraPredAng 5 2 0 −2 −5 −9 −13PredModeIntra 15 16 17 18 19 20 21 IntraPredAng −17 −21 −26 −32 −26 −21−17 PredModeIntra 22 23 24 25 26 27 28 IntraPredAng −13 −9 −5 −2 0 2 5PredModeIntra 29 30 31 32 33 34 IntraPredAng 9 13 17 21 26 32

Table 2 represents an intra directional parameter of eachintra-prediction mode where an index thereof is one of 2 to 34 when 35intra-prediction modes are defined. When directional intra-predictionmodes are defined more than 33, an intra directional parameter of eachintra-prediction mode may be set by subdividing Table 2.

Top reference samples and left reference samples for the current blockare arranged in a line, and then a prediction sample may be obtained onthe basis of a value of an intra directional parameter. In thisconnection, when a value of the intra directional parameter is anegative value, left reference samples and top reference samples may bearranged in a line.

FIGS. 19 and 20 are views respectively showing examples ofone-dimensional arrangement where reference samples are arranged in aline.

FIG. 19 is a view showing vertical directional one-dimensionalarrangement where reference samples are arranged in a verticaldirection, and FIG. 20 is a view showing horizontal directionalone-dimensional arrangement where reference samples are arranged in ahorizontal direction. Examples of FIGS. 19 and 20 will be described inassumption that 35 intra-prediction modes are defined.

When an intra-prediction mode index is any one of 11 to 18, horizontaldirectional one-dimensional arrangement may be applied where topreference samples are rotated in counterclockwise, and when anintra-prediction mode index is any one of 19 to 25, vertical directionalone-dimensional arrangement may be applied where left reference samplesare rotated in clockwise. When arranging reference samples in a line, anintra-prediction mode angle may be considered.

A reference sample determining parameter may be determined on the basisof an intra directional parameter. The reference sample determiningparameter may include a reference sample index for specifying a sample,and a weighting factor parameter for determining a weighting factorapplied to the reference sample.

A reference sample index, iIdx, and a weighting factor parameter, ifact,may be respectively obtained through Equations 2 and 3 below.

iIdx=(y+1)*P _(ang)/32  [Equation 2]

i _(fact)=[(y+1)*P _(ang)]&31  [Equation 3]

In Equations 2 and 3, P_(ang) represents an intra directional parameter.A reference sample specified by a reference sample index of iIdxcorresponds to an integer pel.

In order to derive a prediction sample, at least one reference samplemay be specified. In detail, according to a slope of a prediction mode,a position of a reference sample used for deriving a prediction samplemay be specified. In an example, a reference sample used for deriving aprediction sample may be specified by using a reference sample index ofiIdx.

In this connection, when a slope of an intra-prediction mode is notrepresented by one reference sample, a prediction sample may begenerated by performing interpolation on a plurality of referencesamples. In an example, when a slope of an intra-prediction mode is avalue between a slope between a prediction sample and a first referencesample, and a slope between the prediction sample and a second referencesample, the prediction sample may be obtained by performinginterpolation on the first reference sample and the second referencesample. In other words, when an angular line according to anintra-prediction angle does not pass a reference sample positioned at aninteger pel, a prediction sample may be obtained by performinginterpolation on reference samples positioned adjacent to the left andthe right, or the top and the bottom of the position where the angularline passes.

Equation 4 below represents an example of obtaining a prediction sampleon the basis of reference samples.

P(x,y)=((32-7i _(fact))/32)*Ref_1D(x+iIdx+1)+(i_(fact)/32)*Ref_1D(x+iIdx+2)  [Equation 4]

In Equation 4, P represents a prediction sample, and Ref_1D representsany one of reference samples that are arranged in a line. In thisconnection, a position of the reference sample may be determined by aposition (x, y) of the prediction sample and a reference sample index ofiIdx.

When a slope of an intra-prediction mode is possibly represented by onereference sample, a weighting factor parameter of ifact is set to 0.Accordingly, Equation 4 may be simplified as Equation 5 below.

P(x,y)=Ref_1D(x+iIdx+1)  [Equation 5]

Intra-prediction for a current block may be performed on the basis of aplurality of intra-prediction modes. In an example, an intra-predictionmode may be derived for each prediction sample, and a prediction samplemay be derived on the basis of an intra-prediction mode assigned to eachprediction sample.

Alternatively, an intra-prediction mode may be derived for each region,intra-prediction for each region may be performed on the basis of anintra-prediction mode assigned to each region. In this connection, theregion may include at least one sample. At least one of a size and ashape of the region may be adaptively determined on the basis of atleast one of a size of the current block, a shape of the current block,and an intra-prediction mode for the current block. Alternatively, atleast one of a size and a shape of the region may be predefined in theencoder and the decoder independent to a size or shape of the currentblock.

FIG. 21 is a view showing a degree formed between directionalintra-prediction modes and a straight line parallel to an x axis.

As an example shown in FIG. 21, directional prediction modes may bepresent between the lower-left diagonal direction and the top-rightdiagonal direction. Describing a degree formed between the x axis and adirectional prediction mode, directional prediction modes may be presentfrom 45 degrees (bottom-left diagonal direction) to −135 degrees(top-right diagonal direction).

When a current block is a non-square, a case may be present where aprediction sample is derived by using, among reference samplespositioned at the angular line according to an intra-prediction angle, areference sample that is positioned farther than a reference sampleclose to a prediction sample according to an intra-prediction mode forthe current block.

FIG. 22 is a view shown an aspect of obtaining a prediction sample whena current block is a non-square.

In an example, as an example shown in FIG. 22 (a), it is assumed that acurrent block is a non-square where a width is greater than a height,and an intra-prediction mode for the current block is a directionalintra-prediction mode having an angle from degree to 45 degrees. In theabove case, when deriving a prediction sample A around a right column ofthe current block, among reference samples positioned at the angularmode according to the above degree, rather than using a top referencesample T close to the prediction sample, a case may be present where aleft reference sample L far away from the prediction sample is used.

In another example, as an example shown in FIG. 22 (b), it is assumedthat a current block is a non-square where a height is greater than awidth, and an intra-prediction mode for the current block is adirectional intra-prediction mode from −90 degrees to −135 degrees. Inthe above case, when deriving a prediction sample A around a bottom rowof the current block, among reference samples positioned at the angularmode according to the above degree, rather than using a left referencesample L close to the prediction sample, a case may be present where atop reference sample T far away from the prediction sample is used.

To solve the above problem, when a current block is a non-square, anintra-prediction mode for the current block may be substituted with anintra-prediction mode in opposite direction. Accordingly, for anon-square block, directional prediction modes having angles greater orsmaller than those of directional prediction modes shown in FIG. 18 maybe used. The above directional intra-prediction mode may be defined as awide angle intra-prediction mode. A wide angle intra-prediction moderepresents a directional intra-prediction mode that does not belong to arange of 45 degrees to −135 degrees.

FIG. 23 is a view showing wide angle intra-prediction modes.

In an example show in FIG. 23, intra-prediction modes having indicesfrom −1 to −14 and intra-prediction modes having indices from 67 to 80represent wide angle intra-prediction modes.

In FIG. 23, 14 wide angle intra-prediction modes (from −1 to −14) whichare greater in angle than 45 degrees and 4 wide angle intra-predictionmodes (from 67 to 80) which are smaller in angle than −135 degrees areshown. However, more or fewer number of wide angle intra-predictionmodes may be defined.

When a wide angle intra-prediction mode is used, a length of topreference samples may be set to 2W+1, and a length of left referencesamples may be set to 2H+1.

By using a wide angle intra-prediction mode, a sample A shown in FIG. 23(a) may be predicted by using a reference sample T, and a sample A shownin FIG. 23 (b) may be predicted by a reference sample L.

In addition to legacy intra-prediction modes and N wide angleintra-prediction modes, a total of 67+N intra-prediction modes may beused. In an example, Table 3 represents an intra directional parameterfor intra-prediction modes when 20 wide angle intra-prediction modes aredefined.

TABLE 3 PredModeIntra −10 −9 −8 −7 −6 −5 −4 −3 −2 intraPredAngle 114 9379 68 60 54 49 45 39 PredModeIntra −1 2 3 4 5 6 7 8 9 intraPredAngle 3532 29 26 23 21 19 17 15 PredModeIntra 10 11 12 13 14 15 16 17 18intraPredAngle 13 11 9 7 5 3 2 1 0 PredModeIntra 19 20 21 22 23 24 25 2627 intraPredAngle −1 −2 −3 −5 −7 −9 −11 −13 −15 PredModeIntra 28 29 3031 32 33 34 35 36 intraPredAngle −17 −19 −21 −23 −26 −29 −32 −29 −26PredModeIntra 37 38 39 40 41 42 43 44 45 intraPredAngle −23 −21 −19 −17−15 −13 −11 −9 −7 PredModeIntra 46 47 48 49 50 51 52 53 54intraPredAngle −5 −3 −2 −1 0 1 2 3 5 PredModeIntra 55 56 57 58 59 60 6162 63 intraPredAngle 7 9 11 13 15 17 19 21 23 PredModeIntra 64 65 66 6768 69 70 71 72 intraPredAngle 26 29 32 35 39 45 49 54 60 PredModeIntra73 74 75 76 intraPredAngle 68 79 93 114

When a current block is a non-square, and an intra-prediction mode forthe current block which is obtained in S2502 belongs to a transformrange, the intra-prediction mode for the current block may betransformed into a wide angle intra-prediction mode. The transform rangemay be determined on the basis of at least one of a size, a shape, or aratio of the current block. In this connection, the ratio may representa ratio between a width and a height of the current block.

When a current block is a non-square where a width is greater than aheight, a transform range may be set from an intra-prediction mode index(for example, 66) of an top-right diagonal direction to (anintra-prediction mode index of the top-right diagonal direction−N). Inthis connection, N may be determined on the basis of a ratio of thecurrent block. When an intra-prediction mode for the current blockbelongs to a transform range, the intra-prediction mode may betransformed into a wide angle intra-prediction mode. The transform maybe subtracting a predefined value from the intra-prediction mode, andthe predefined value may be the total number (for example, 67) ofintra-prediction modes excluding a wide angle intra-prediction mode.

In the above example, intra-prediction mode from the number 66 to thenumber 53 may be respectively transformed into wide angleintra-prediction modes from the number −1 to the number 14.

When a current block is a non-square where a height is greater than awidth, a transform range may be set from an intra-prediction mode index(for example, 2) of a bottom-left diagonal direction to (theintra-prediction mode index of the lower-left diagonal direction+M). Inthis connection, M may be determined on the basis of a ratio of thecurrent block. When an intra-prediction mode for the current blockbelongs to a transform range, the intra-prediction mode may betransformed into a wide angle intra-prediction mode. The transform maybe adding a predefined value to the intra-prediction mode, and thepredefined value may be the total number (for example, 65) ofdirectional intra-prediction mode excluding a wide angleintra-prediction mode.

In the above example, intra-prediction mode from the number 2 to thenumber 15 may be respectively transformed into wide angleintra-prediction modes from the number 67 to the number 80

Hereinafter, intra-prediction modes belonging to a transform range arereferred to as wide angle intra prediction replacement modes.

A transform range may be determined on the basis of a ratio of thecurrent block. In an example, Tables 4 and 5 respectively show atransform range of a case where 35 intra-prediction modes excluding awide angle intra-prediction mode are defined, and a case where 67intra-prediction modes excluding a wide angle intra-prediction mode aredefined.

TABLE 4 Condition Replaced Intra Prediction Modes W/H = 2 Modes 2, 3, 4W/H > 2 Modes 2, 3, 4, 5, 6 W/H = 1 None H/W = 1/2 Modes 32, 33, 34 H/W< 1/2 Modes 30, 31, 32, 33, 34

TABLE 5 Condition Replaced Intra Prediction Modes W/H = 2 Modes 2, 3, 4,5, 6, 7 W/H > 2 Modes 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 W/H = 1 None H/W =1/2 Modes 61, 62, 63, 64, 65, 66 H/W < 1/2 Modes 57, 58, 59, 60, 61, 62,63, 64, 65, 66

As examples shown in Tables 4 and 5, the number of wide angle intraprediction replacement modes included in a transform range may varyaccording to a ratio of the current block.

The ratio of the current block may be further subdivided to set atransform range as shown in Table 6 below.

TABLE 6 Condition Replaced Intra Prediction Modes W/H = 16 Modes 12, 13,14, 15 W/H = 8 Modes 12, 13 W/H = 4 Modes 2, 3, 4, 5, 6, 7, 8, 9, 10, 11H/W = 2 Modes 2, 3, 4, 5, 6, 7 H/W = 1 None W/H = 1/2 Modes 61, 62, 63,64, 65, 66 W/H = 1/4 Modes 57, 58, 59, 60, 61, 62, 63, 64, 65, 66 W/H =1/8 Modes 55, 56 H/W = 1/16 Modes 53, 54, 55, 56

When the non-adjacent reference sample line is determined as thereference sample line for the current block or when the multi-line intraprediction encoding method for selecting one of the plurality ofreference sample lines is used, the prediction method may be configurednot to use the wide angle intra prediction mode. That is, although thecurrent block has a non-square shape, and the intra prediction mode forthe current block belongs to the transform range, the intra predictionmode for the current block may not be transformed into the wide angleintra prediction mode.

Alternatively, when the intra prediction mode for the current block isdetermined as the wide angle intra prediction mode, the predictionmethod may be configured such that the non-adjacent reference samplelines are unavailable as the reference sample line for the current blockor may be configured not to use the multi-line intra prediction encodingmethod for selecting one of the plurality of reference sample lines.When the multi-line intra prediction encoding method is not used, theadjacent reference sample line may be determined as the reference sampleline for the current block.

When the wide angle intra prediction mode is not used, each of refW andrefH may be set to a sum of nTbW and nTbH. Accordingly, the non-adjacentreference sample line spaced from the current block by i may include(nTbW+nTbH+offsetX[i]) top reference samples and (nTbW+nTbH+offsetY[i])left reference samples except for the left-top reference sample. Thatis, the non-adjacent reference sample line spaced from the current blockby i may include (2nTbW+2nTbH+offsetX[i]+offsetY[i]+1) referencesamples. For example, when a value of whRatio is greater than 1, a valueof offsetX may be set to be larger than a value of offsetY. In oneexample, when the value of offsetX may be set to 1, and the value ofoffsetY may be set to 0. To the contrary, when the value of whRatio issmaller than 1, the value of offsetY may be set to be larger than thevalue of offsetX. In one example, the value of offsetX may be set to 0,and the value of offsetY may be set to 1.

Since wide angle intra-prediction modes are used in addition to legacyintra-prediction modes, resource for encoding wide angleintra-prediction modes may be increased, and thus encoding efficiencymay be reduced. Accordingly, rather than encoding a wide angleintra-prediction mode as it is, a replaced intra-prediction mode for thewide angle intra-prediction modes are encoded so as to improve encodingefficiency.

In an example, when a current block is encoded by using a wide angleintra-prediction mode of the number 67, the number 2 that is a wideangle replacement intra-prediction mode of the number 67 may be encodedas an intra-prediction mode for the current block. In addition, when acurrent block is encoded by using a wide angle intra-prediction mode ofthe number −1, the number 66 that is a wide angle replacementintra-prediction mode of the number −1 may be encoded as anintra-prediction mode for the current block.

The decoder may decode an intra-prediction mode for the current block,and determine whether or not the decoded intra-prediction mode belongsto a transform range. When the decoded intra-prediction mode is a wideangle replacement intra-prediction mode, the intra-prediction mode maybe transformed into a wide angle intra-prediction mode.

Alternatively, when a current block is encoded through a wide angleintra-prediction mode, the wide angle intra-prediction mode may beencoded as it is.

Encoding of an intra prediction mode may be performed based on an MPMlist described above. Specifically, when a neighboring block is encodedin a wide angle intra prediction mode, an MPM may be set based on a wideangle replacement intra prediction mode corresponding to the wide angleintra prediction mode.

A residual image may be derived by subtracting a prediction image froman original image. In this connection, when the residual image isconverted into a frequency domain, even though high frequency componentsare removed from frequency components, subjective image quality of theimage does not drop significantly. Accordingly, when values of highfrequency components are transformed into small values, or when valuesof high frequency components are set to 0, compression efficiency may beincreased without causing large visual distortion. Reflecting the abovefeature, transform may be performed on a current block so as todecompose a residual image to two-dimensional frequency components. Thetransform may be performed by using transform methods such as DCT(discrete cosine transform), DST (discrete sine transform), etc.

A transform method may be determined on a basis of a block. A transformmethod may be determined on the basis of at least one of a predictionencoding mode for a current block, a size of the current block, or asize of the current block. In an example, when a current block isencoded through an intra-prediction mode, and a size of the currentblock is smaller than N×N, transform may be performed by using atransform method of DST. On the other hand, when the above condition isnot satisfied, transform may be performed by using a transform method ofDCT.

For a partial block of a residual image, two-dimensional image transformmay not be performed. Not performing two-dimensional image transform maybe referred to as transform skip. When transform skip is applied,quantization may be applied to residual values for which transform isnot performed.

After performing transform on a current block by using DCT or DST,transform may be performed again on the transformed current block. Inthis connection, transform based on DCT or DST may be defined as firsttransform, and performing transform again on a block to which firsttransform is applied may be defined as second transform.

First transform may be performed by using any one of a plurality oftransform core candidates. In an example, first transform may beperformed by using any one of DCT2, DCT8, or DCT7.

Different transform cores may be used for a horizontal direction and avertical direction. Information representing a combination of atransform core of a horizontal direction and a transform core of avertical direction may be signaled in a bitstream.

A processing unit of first transform may differ with second transform.In an example, first transform may be performed on an 8×8 block, andsecond transform may be performed on a 4×4 sized sub-block within thetransformed 8×8 block. In this connection, a transform coefficient forremaining regions for which second transform is not performed may be setto 0.

Alternatively, first transform may be performed on a 4×4 block, andsecond transform may be performed on a region having an 8×8 sizeincluding the transformed 4×4 block.

Information representing whether or not to perform second transform maybe signaled in a bitstream.

Alternatively, whether to perform the second transform may be determinedbased on whether a horizontal directional transform core and a verticaldirectional transform core are identical with each other. In oneexample, the second transform may be performed only when the horizontaldirectional transform core and the vertical directional transform coreare identical with each other. Alternatively, the second transform maybe performed only when the horizontal directional transform core and thevertical directional transform core are different from each other.

Alternatively, the second transform may be allowed only when apredefined transform core is used for the horizontal directionaltransform and the vertical directional transform. In one example, when aDCT2 transform core is used for transform in the horizontal directionand transform in the vertical direction, the second transform may beallowed.

Alternatively, it may be determined whether to perform the secondtransform based on the number of non-zero transform coefficients of thecurrent block. In one example, when the number of the non-zerotransforms coefficient of the current block is smaller than or equal toa threshold, the prediction method may be configured not to use thesecond transform. When the number of the non-zero transform coefficientsof the current block is greater than the threshold, the predictionmethod may be configured to use the second transform. As long as thecurrent block is encoded using intra prediction, the prediction methodmay be configured to use the second transform.

The decoder may perform inverse-transform (second inverse-transform) tothe second transform and may perform inverse-transform (firstinverse-transform) to the first transform resultant from the secondinverse-transform. As a result of performing the secondinverse-transform and the first inverse-transform, residual signals forthe current block may be obtained.

When transform and quantization are performed by the encoder, thedecoder may obtain the residual block via inverse-quantization andinverse-transform. The decoder may add the prediction block and theresidual block to each other to obtain the reconstructed block for thecurrent block.

When the reconstructed block of the current block is obtained, loss ofinformation as occurring in the process of the quantization and encodingmay be reduced via the in-loop filtering. The in-loop filter may includeat least one of a deblocking filter, a sample adaptive offset filter(SAO), or an adaptive loop filter (ALF). Hereinafter, a reconstructedblock before an in-loop filter is applied is referred to as a firstreconstructed block and a reconstructed block after an in-loop filter isapplied is referred to as a second reconstructed block.

The second reconstructed block may be obtained by applying at least oneof a deblocking filter, SAO or ALF to the first reconstructed block. Inthis connection, SAO or ALF may be applied after the deblocking filteris applied.

A deblocking filter is to alleviate quality degradation (e.g. BlockingArtifact) on a boundary of a block which occurs as quantization isperformed per block. To apply the deblocking filter, a blocking strength(BS) between the first reconstructed block and a neighboringreconstructed block may be determined.

FIG. 24 is a flow diagram showing a process of determining a blockingstrength.

In an example shown in FIG. 24, P represents a first reconstructed blockand Q represents a neighboring reconstructed block. In this connection,the neighboring reconstructed block may neighbor a left or top of thecurrent block.

An example shown in FIG. 24 showed that a blocking strength isdetermined considering a prediction encoding mode of P and Q, whether atransform coefficient which is not 0 is included, whetherinter-prediction is performed by using the same reference picture orwhether the difference value of motion vectors is equal to or greaterthan a threshold value.

Based on a blocking strength, whether a deblocking filter is applied maybe determined. In an example, when the blocking strength is 0, filteringmay not be performed.

SAO is to alleviate ringing artifact which occurs as quantization isperformed in a frequency region. SAO may be performed by adding orsubtracting an offset determined by considering a pattern of a firstreconstructed image. The determination method of the offset includesEdge Offset (EO) or Band Offset (BO). EO represents a method determiningthe offset of a current sample according to a pattern of neighboringpixels. BO represents a method applying a common offset to a group ofpixels with a similar brightness value in a region. Concretely, pixelbrightness may be partitioned into 32 uniform sections and pixels with asimilar brightness value may be set as one group. In an example, 4adjacent bands among 32 bands may be set as one group and the sameoffset value may be applied to samples belonging to 4 bands.

ALF is a method of generating a second reconstructed image by applying afilter with a predefined size/shape to a first reconstructed image or areconstructed image that a deblocking filter is applied. The followingEquation 6 represents an example in which ALF is applied.

$\begin{matrix}{{R^{\prime}( {i,j} )} = {\sum\limits_{k = {- \frac{N}{2}}}^{\frac{N}{2}}{\sum\limits_{l = {- \frac{N}{2}}}^{\frac{N}{2}}{{f( {k,l} )} \cdot {R( {{i + k},{j + l}} )}}}}} & \lbrack {{Equation}\mspace{14mu} 6} \rbrack\end{matrix}$

Any one of predefined filter candidates may be selected in a basis of apicture, a coding tree unit, a coding block, a prediction block or atransform block. At least one of a size or shape of each filtercandidate may be different.

FIG. 25 represents predefined filter candidates.

As in an example shown in FIG. 25, at least any one of a 5×5, 7×7 or 9×9sized diamond shape may be selected.

Only a 5×5 sized diamond shape may be used for a chroma component.

A method of partitioning a picture into a plurality of regions andencoding/decoding the plurality of regions in parallel may be consideredfor the real-time or low delay encoding of a high resolution image suchas a panoramic video, a 360-degree video or 4K/8K UHD (Ultra HighDefinition). Concretely, according to a purpose of processing, a picturemay be partitioned into tiles or slices (or tile groups).

A tile represents a base unit for parallel encoding/decoding. Each tilemay be processed in parallel. A tile may have a rectangular shape.Alternatively, a non-rectangular tile may be allowed. Informationrepresenting whether a non-rectangular tile is allowed or whether thereis a non-rectangular tile may be signaled in a bitstream.

In encoding/decoding a tile, it may be set not to use data of othertile. A parallel processing of tiles may be supported by removingencoding/decoding dependency between tiles. Concretely, a probabilitytable of CABAC (Context Adaptive Binary Arithmetic Coding) context maybe initialized per tile and an in-loop filter may be set not to beapplied on a boundary of tiles. In addition, data in other tile may notbe used as a candidate for deriving a motion vector. For example, datain other tile may be set not to be used as a merge candidate, a motionvector prediction candidate (AMVP candidate) or a motion informationcandidate. In addition, data in another tile may be set not to be usedfor context computation of a symbol.

Information on video encoding/decoding may be signaled by a sliceheader. Information signaled by the slice header may be commonly appliedto coding tree units or tiles included in the slice.

FIG. 26 is a diagram showing a picture partitioning method according toan embodiment of the present disclosure.

First, whether a current picture is partitioned into a plurality ofprocessing units may be determined S2610. In this connection, aprocessing unit may include at least one of a tile or a slice. In anexample, a syntax, no_pic_partition_flag, indicating whether a currentpicture is partitioned into a plurality of tiles or slices, may besignaled in a bitstream. If a value of the syntax,no_pic_partition_flag, is 0, it represents that a current picture ispartitioned into at least one tile or at least one slice. On the otherhand, if a value of a syntax, no_pic_partition_flag, is 1, it representsthat a current picture is not partitioned into a plurality of tiles orslices.

When it is determined that a current picture is not to be partitionedinto a plurality of processing units, a partitioning process of thecurrent picture may be ended. In this connection, it may be understoodthat the current picture is composed of a single tile and a single slice(or a single tile group).

When it is determined that a current picture is to be partitioned into aplurality of processing units, tile partitioning information may besignaled in a bitstream. A picture may be partitioned into at least onetile based on the signaled tile partitioning information S2620.

When a current picture is partitioned into a plurality of tiles, a tilegroup (or a slice) may be determined by combining a plurality of tilesor partitioning a tile S2630.

Hereinafter, according to the present disclosure, a tile partitioningmethod and a tile group determination method will be described indetail.

FIG. 27 represents an example in which a picture is partitioned into aplurality of tiles.

A tile may include at least one coding tree unit. A boundary of the tilemay be set to match a boundary of a coding tree unit. In other words, apartitioning type that one coding tree unit is partitioned into pluralmay not be allowed.

Information representing a partitioning shape of a picture may besignaled in a bitstream. The information may be encoded and signaled bya picture parameter set or a sequence parameter set.

Information representing a partitioning shape of a picture may includeat least one of information indicating whether tiles are partitioned ina uniform size, information representing the number of tile columns orinformation representing the number of tile rows.

Information indicating whether tiles are partitioned in a uniform sizemay be a 1-bit flag, uniform_spacing_flag. When it is determined that apicture is partitioned in a uniform size, remaining tiles except fortiles adjacent to a right and/or bottom boundary of the picture may havethe same size.

As a picture is partitioned by using at least one of a vertical line ora horizontal line across a picture, each tile belongs to a differentcolumn and/or row. To determine a partitioning shape of the picture,information representing the number of tile columns and/or tile rows maybe signaled. In an example, information, num_tile_row_minus1,representing the number of rows formed by tiles, and information,num_tile_column_minus1, representing the number of columns formed bytiles generated by partitioning the picture may be signaled in abitstream. A syntax, num_tile_row_minus1, represents a value subtracting1 from the number of tile rows and a syntax, num_tile_column_minus1,represents a value subtracting 1 from the number of tile columns.

In an example shown in FIG. 27, the number of tile columns is 4 and thenumber of tile rows is 3. Accordingly, num_tile_columns_minus1 mayrepresent 3 and num_tile_rows_minus1 may represent 2.

When a value of a syntax, uniform_tile_spacing_flag, is 1, a size of atile may be determined based on a syntax, num_tile_row_minus1,representing the number of tile rows, and a syntax,num_tile_rows_minus1, representing the number of tile columns.

When a value of a syntax, uniform_tile_spacing_flag, is 1, a size ofeach tile may be determined based on information representing a width ofa tile and information representing a height of a tile. A size ofremaining tiles excluding tiles adjacent to the right and/or the lowerboundary in a current picture may be determined based on informationrepresenting a width of the tile and information representing a heightof the tile.

One tile may be configured with at least one coding tree unit. Remainingtiles excluding a tile adjacent to the right or the lower boundary of apicture may be set not to be configured by including a region smallerthan a coding tree unit. In other words, the boundary of a tile matchesthat of a coding tree unit.

A set of tiles belonging to one line (row or column) may be referred toas a tile set. In an example, a horizontal directional tile set may meana set of tiles belonging to one row and a vertical directional tile setmay mean a set of tiles belonging to one column.

According to a partitioning shape of a picture, tiles may have the samesize in all regions excluding a picture boundary. Alternatively, aheight of tiles which are adjacent horizontally may be set to be thesame or a width of tiles which are adjacent vertically may be set to bethe same.

Information representing a size of a tile column and/or a size of a tilerow may be signaled in a bitstream. The size of the tile column may bedetermined based on the number of coding tree unit columns included inthe tile column and the size of the tile row may be determined based onthe number of coding tree unit rows included in the tile row.

Information representing whether a current picture is partitioned into aplurality of tiles may be signaled in a bitstream. In an example, asyntax, single_tile_in_pic_flag, may be signaled in a bitstream. When asyntax, single_tile_in_pic_flag, is 1, it represents that a currentpicture is not partitioned into a plurality of tiles. On the other hand,when single_tile_in_pic_flag is 0, it represents that a current pictureis partitioned into a plurality of tiles.

When a current picture is determined to be partitioned into a pluralityof tiles, information for determining the number of tile columns andtile rows, information representing whether tiles are uniformlypartitioned and information for determining a size of a tile column anda tile row may be encoded.

TABLE 7 pic_parameter_set_rbsp( ) { Descriptor pps_pic_parameter_set_idue(v) pps_seq_parameter_set_id ue(v) transform_skip_enabled_flag u(1)single_tile_in_pic_flag u(1) if( !single_tile_in_pic_flag ) { num_tile_columns_minus1 ue(v)  num_tile_rows_minus1 ue(v) uniform_tile_spacing_flag u(1)  if( !uniform_tile_spacing_flag ) {  for( i = 0; i < num_tile_columns_minus1; i++ )   tile_column_width_minus1[ i ] ue(v)   for( i = 0; i <num_tile_rows_minus1; i++ )    tile_row_height_minus1[ i ] ue(v)  }

Information for determining a tile size may be encoded and signaled. Inan example, a syntax element, tile_width_minus1[i], representing a widthof the i-th tile column, and a syntax element, tile_height_minus1[i],representing a height of the i-th tile row may be encoded in abitstream.

Information for specifying the number of tile columns whose width isexplicitly signaled in a current picture may be signaled in a bitstream.In an example, a syntax, num_exp_tile_columns_minus1, for determiningthe number of tile columns whose width is signaled, may be signaled in abitstream. A syntax, num_exp_tile_columns_minus1, may be a valuesubtracting 1 from the number of tile columns whose width is signaled.When an index i of a tile column is below the number of tile columnswhose width is signaled, a width of the corresponding tile column may bedetermined based on a syntax, tile_width_minus1[i], signaled in abitstream. On the other hand, when an index j of a tile column is equalto or greater than the number of tile columns whose width is signaled, awidth of the corresponding tile column may be set the same as a syntax,tile_width_minus1[l], which is signaled last. In this case, 1 may be aninteger smaller than j.

Alternatively, information for specifying the number of tile rows whoseheight is signaled in a current picture may be signaled in a bitstream.In an example, a syntax, num_exp_tile_rows_minus1, for determining thenumber of tile rows whose height is signaled, may be signaled in abitstream. A syntax, num_exp_tile_rows_minus1, may be a valuesubtracting 1 from the number of tile rows whose height is signaled.When an index i of a tile row is below the number of tile rows whoseheight is signaled, a height of the corresponding tile row may bedetermined based on a syntax, tile_height_minus1[i], signaled in abitstream. On the other hand, when an index j of a tile row is equal toor greater than the number of tile rows whose height is signaled, aheight of the corresponding tile row may be set the same as a syntax,tile_height_minus1[1], which is signaled last. In this case, 1 may be aninteger smaller than j.

A decoder may determine a size of a tile based on the number of codingtree unit columns and/or the number of coding tree unit rows derivedbased on the syntax elements and a size of a coding tree unit. In anexample, a width of an i-th tile column may be set by(tile_width_minus1[i]+1)*(a width of a coding tree unit) and a height ofthe j-th tile row may be set by (tile_height_minus1[j]+1)*(a height of acoding tree unit). Accordingly, a size of a tile belonging to the i-thtile column and the j-th tile row may be set by((tile_width_minus1[i]+1)*(a width of a coding treeunit)×(tile_height_minus1[j]+1)*(a height of a coding tree unit)).

On the other hand, information representing a size of a coding tree unitmay be signaled by a sequence parameter set or by a picture parameterset.

An identifier (hereinafter referred to as a tile index, tile idx) foridentifying a tile to which a coding tree unit belongs may be assignedto each coding tree unit. According to a raster scanning, a verticalscanning, a horizontal scanning or a diagonal scanning order, a tileindex may be assigned. The order of assigning a tile index may bepredefined in an encoding device and a decoding device. In an example,according to a raster scanning order, a tile index may be assigned.Alternatively, a scanning order may be determined by considering a sizeof the first tile (e.g., a width or/and a height). When a width of thefirst tile is greater than a height, a horizontal scanning may be usedand when a height of the first tile is greater than a width, a verticalscanning may be used. When a width and a height of the first tile arethe same, a raster scanning or a diagonal scanning may be used.

A tile may be recursively partitioned. In an example, one tile may bepartitioned into a plurality of tiles. Each of a plurality of tilesgenerated by partitioning a tile may be referred to as a sub-tile or abrick. A brick may be a unit of parallel processing. In an example, abrick may be independently encoded/decoded each other. Inencoding/decoding a block included in a brick, it may be set not to usedata of another block. In an example, a sample included in another brickmay be set to be unavailable as a reference sample for intra prediction.Alternatively, data in another brick may be set not to be used as amerge candidate, a motion vector prediction candidate (AMVP candidate)or a motion information candidate.

In another example, information representing whether parallel processingbetween bricks is required may be signaled in a bitstream. Whether dataincluded in another brick is used in encoding/decoding a block may bedetermined by the information.

FIG. 28 is a diagram for explaining a generation aspect of a brick.

A brick may be generated by partitioning a tile in a horizontaldirection. In an example, an example shown in FIG. 28 showed that tilesbelonging to the last tile column in a current picture are partitionedinto 2 bricks.

When it is assumed that a raster scan is applied to tiles, a raster scanmay be applied between bricks. In an example, after scanning all bricksincluded in a specific tile, a subsequent tile may be scanned. In otherwords, a brick may have the same status as a tile.

The boundary of a brick may match that of a coding tree unit. In otherwords, at least one coding tree unit row in a tile may be defined as abrick.

Information representing whether a tile is partitioned into a pluralityof bricks may be signaled in a bitstream. Table 8 represents a syntaxtable including information for determining whether a tile ispartitioned.

TABLE 8 pic_parameter_set_rbsp( ) { Descriptor pps_pic_parameter_set_idue(v) pps_seq_parameter_set_id ue(v) single_tile_in_pic_flag u(1) if(!single_tile_in_pic_flag ) {  uniform_tile_spacing_flag u(1)  if(uniform_tile_spacing_flag ) {   tile_cols_width_minus1 ue(v)  tile_rows_height_minus1 ue(v)  } else {   num_tile_columns_minus1ue(v)   num_tile_rows_minus1 ue(v)   for( i = 0; i <num_tile_columns_minus1;i++ )    tile_column_width_minus1[ i ] ue(v)  for( i = 0; i <num_tile_rows_minus1; i++ )    tile_row_height_minus1 ]i ] ue(v)  }  brick_splitting_present_flag u(1)  for( i = 0;brick_splitting_present_flag && i <  NumTilesInPic; i++ ) {  brick_split_flag[ i ] u(1)   if( brick_split_flag[ i ] ) {   uniform_brick_spacing_flag[ i ] u(1)    if(uniform_brick_spacing_flag[ i ] )     brick_height_minus1[ i ] ue(v)   else {     num_brick_rows_minus1[ i ] ue(v)     for( j = 0; j <num_brick_rows_minus1[ i ]; j++ )      brick_row_height_minusl[ i ][ j ]ue(v)    }   }  }  single_brick_per_slice_flag u(1)  if(!single_brick_per_slice_flag )   rect_slice_flag u(1)  if(rect_slice_flag && !single_brick_per_slice_flag ) {  num_slices_in_pic_minus1 ue(v)   for( i = 0; i <=num_slices_in_pic_minus1; i++ ) {    if( i > 0 )     top_left_brick_idx[i ] u(v)    bottom_right_brick_idx_delta[ i ] u(v)   }  } loop_filter_across_bricks_enabled_flag u(1)  if(loop_filter_across_bricks_enabled_flag )  loop_filter_across_slices_enabled_flag u(1) }

When it is determined that a tile partitioned into a plurality of bricksis present in a current picture, a syntax, brick_split_flag[i],representing whether the i-th tile is partitioned into a plurality ofbricks, may be signaled. In an example, when a value of a syntax,brick_split_flag[i], is 1, it represents that a tile whose tile index isi is partitioned into two or more bricks. When a value of a syntax,brick_split_flag[i], is 0, it represents that a tile whose tile index isi is not partitioned.

When a tile is partitioned into a plurality of bricks, information fordetermining a partition aspect of a tile may be signaled in a bitstream.In an example, a syntax, uniform_brick_spacing_flag, may be signaled ina bitstream. When a syntax, uniform_brick_spacing_flag, is 1, itrepresents that a height of bricks in a tile is uniform. When a value ofuniform_brick_spacing_flag is 1, a syntax brick_height_minus1,representing a base height of a brick may be signaled. Remaining bricksexcluding the last brick in a tile may have a base height determined bya syntax, brick_height_minus1. The last brick in a tile may be set as aremaining region excluding the other bricks.

When a value of a syntax, uniform_brick_spacing_flag, is 0, a syntax,num_brick_rows_minus1[i], representing the number of bricks in the i-thtile and a syntax, brick_row_height_minus1[i][j], representing a heightof the j-th brick in the i-th tile may be signaled.

The signaling of a syntax, brick_row_height_minus1[i], may be omittedfor the last brick in a tile. A height of the last brick in a tile maybe derived by subtracting a sum of heights of previous bricks from aheight of a tile.

A syntax, brick_height_minus1[i], representing a height of a brick mayhave a value smaller than a value subtracting 1 from a height of a tileincluding a brick. In an example, when a height of a tile is rowHeight,a syntax, brick_height_minus1[i], may have a value between 0 androwHeight−2. In this case, rowHeight represents the number of codingtree unit rows included by a tile.

A tile and a brick may be identified by a tile index. A tile index maybe assigned to each tile and brick in the raster scanning order. Whenone tile is partitioned into a plurality of bricks, a tile index may beassigned to each of a plurality of bricks.

In the after-mentioned embodiment, a term, ‘a tile’, may include tilesgenerated by partitioning a tile (i.e., a sub-tile or a brick) as wellas a tile.

At least one or more tiles may be defined as one processing unit. In anexample, a plurality of tiles may be defined as one tile group. A tilegroup may be referred to as a slice.

Alternatively, one tile may be partitioned into a plurality ofprocessing units. In an example, a tile may be partitioned into aplurality of slices. In this connection, one slice may include at leastone coding tree unit column. When a tile is partitioned into a pluralityof slices, information representing a height of each slice may besignaled in a bitstream.

Information representing the total number of tile groups in a sequenceor in a picture may be signaled in a bitstream. In an example, a syntax,numTotalTileGroup_minus1, representing the total number of tile groupsin a sequence or in a picture may be signaled.

When a plurality of tile groups are included in a picture, addressinformation of a tile group may be signaled to identify each tile group.In an example, a syntax, tile group index, representing an index of eachtile group, may be signaled per tile group.

Video encoding/decoding information may be signaled through a tile groupheader. Information signaled through the tile group header may becommonly applied to tiles belonging to the tile group.

Information for determining a tile group included in a picture may besignaled in a bitstream. The information may include informationrepresenting the number of tile groups in a picture and/or informationrepresenting a partitioning method of a tile group. In an example, asyntax, num_tilegroups_in_pic_minus1, representing the number of tilegroups in a picture, may be signaled in a bitstream. In addition, asyntax, rec_tile_group_flag, representing a partitioning method of atile group may be signaled in a bitstream.

A syntax, rec_tile_group_flag, represents whether a tile group isdefined based on a raster scanning order or whether a tile group isdefined in a rectangular shape. In an example, if rec_tile_group_flag is0, it represents that a tile group is defined based on the rasterscanning order of tiles. On the other hand, if rec_tile_group_flag is 1,it represents that a tile group is defined in a rectangular shape.

Hereinafter, the above two methods for determining a tile group will bedescribed in detail.

A tile group may be defined based on the raster scanning order of tiles.A raster scanning tile group is to define one or more consecutivetile(s) as a tile group in the raster scanning order. When a rasterscanning tile group is applied, a non-rectangular tile group may begenerated.

FIGS. 29 and 30 represent an example in which a tile group is definedbased on the raster order.

In an example, in an example shown in FIG. 29, when it is assumed that afirst tile group, tile group0, includes 3 tiles, the first tile group,tile group0, may be defined to include Tile0 to Tile2 in the rasterscanning order. When it is assumed that a second tile group, tilegroup1, includes 6 tiles, the second tile group, tile group1, may bedefined to include Tile3 to Tile8 in the raster scanning order. The lasttile group, tile group2, may include the remaining tiles, Tile9 to Tile11, in the raster scanning order.

When a tile group is defined in the raster scanning order, informationrepresenting the number of tiles included in each tile group may besignaled to determine tiles included in each tile group. For the lasttile group, information representing the number of tiles included in thetile group may be omitted.

A width or height of tiles included in a tile group may be different. Inan example, it was shown that a height of Tile3 among tiles included inthe second tile group, Tile group1, is different from that of theremaining tiles.

Alternatively, tiles with different width or height may be set not to beincluded in one tile group. In an example, an example shown in FIG. 29showed that Tile3 with a height of 2 and Tile4 to Tile 8 with a heightof 3 constitute one tile group, but such combination of tiles may be setto be unallowable. In other words, as in an example shown in FIG. 30, itmay be set so that one tile group does not include tiles with differentheight. An example shown in FIG. 30 showed that a tile group includingTile3 to Tile8 shown in FIG. 29 is partitioned into two tile groups,tile group1 and tile group2. Accordingly, the second tile group, tilegroup1, includes only Tile3 with a height of 2 and the third tile group,tile group 2, includes only Tile4 to Tile8 with a height of 3.

A tile group may be defined in a rectangular shape. A rectangular tilegroup is to define a tile group in a rectangular shape. When arectangular tile group is applied, tiles positioned at four corners of atile group belong to the same row or the same column.

FIG. 31 is a diagram showing an example in which only a rectangular tilegroup is allowed.

As in an example shown in FIG. 31, a fourth tile group, tile group3,includes Tile5, Tile6, Tile9 and Tile10. As in a shown example, when atile group includes a plurality of tiles, a rectangle with a left-toptile and a right-bottom tile constituting a tile group as two verticesmay be defined as one tile group.

The boundary of a tile group may match that of a picture and/or that ofa tile. In an example, the left boundary or the upper boundary of a tilegroup may be set as the boundary of a picture, or the left boundary orthe upper boundary of a tile group may be set as the boundary of a tile.

When a tile group is defined in a square shape, information foridentifying tiles included in each tile group may be signaled todetermine tiles included in each tile group. The information may be foridentifying an index of a tile positioned at a top-left of the tilegroup and an index of a tile positioned at a bottom-right of the tilegroup. In an example, a syntax, top_left_tile_idx, for identifying anindex of a tile positioned at a top-left of a tile group, and a syntax,bottom_right_tile_idx, for identifying an index of a tile positioned ata bottom-right of a tile group may be signaled in a bitstream. For thelast tile group, encoding of at least one of a syntax for identifying anindex of a tile positioned at the top-left of the tile group or a syntaxfor identifying an index of a tile positioned at the bottom-right of thetile group may be omitted.

In an example, in an example shown in FIG. 31, for tile group0, tilegroup1 and tile group2, top_left_tile_idx, an index of a tile indexpositioned at the top-left of each tile group, andbottom_right_tile_idx, an index of a tile positioned at the bottom-rightof each tile group may be signaled. On the other hand, for tile group3which is the last tile group in a picture, encoding of top_left_tile_idxand bottom_right_tile_idx may be omitted. An index of a tile positionedat the top-left of tile group3 may be set as an index of a tilepositioned at the top-left of the remaining region excluding tilegroup0,tile group1 and tile group2 in a picture and an index of a tilepositioned at the bottom-right of tile group3 may be set as the index ofa tile positioned at the bottom-right of the above remaining region (or,a tile positioned at the bottom-right of a picture).

Alternatively, information representing a difference value between anindex of a tile positioned at a top-left of a tile group and an index ofa tile positioned at a bottom-right of the tile group may be signaled ina bitstream. In an example, for the i-th tile group, a syntax,top_left_tile_idx[i], for identifying an index of a tile positioned at atop-left of a tile group, and a syntax, bottom_right_tile_idx delta[i],representing a difference value between an index of a tile positioned ata top-left of a tile group and an index of a tile positioned at abottom-right of a tile group may be signaled. An index of a tilepositioned at a bottom-right of the i-th tile group may be derived bycombining top_left_tile_idx[i] and bottom_right_tile_idx delta[i]. Forthe last tile group, encoding of at least one of a syntax representingan index of a tile positioned at a top-left of a tile group or a syntaxrepresenting a difference value between an index of a tile positioned ata top-left of a tile group and an index of a tile positioned at abottom-right of a tile group may be omitted.

Table 9 represents a syntax table including information representing anindex difference.

TABLE 9 pic_parameter_set_rbsp( ) { Descriptor pps_pic_parameter_set_idue(v) pps_seg_parameter_set_id ue(v) single_tile_in_pic_flag u(1) if(!single_tile_in_pic_flag ) {  uniform_tile_spacing_flag u(1)  if(uniform_tile_spacing_flag ) {   tile_cols_width_minus1 ue(v)  tile_rows_height_minus1 ue(v)  } else {   num_tile_columns_minuslue(v)   num_tile_rows_minusl ue(v)   for( i = 0; i <num_tile_columns_minus1; i++ )    tile_column_width_minus1[ i ] ue(v)  for( i = 0; i < num_tile_rows_minus1; i++ )    tile_row_height_minus1[i ] ue(v)  }  brick_splitting_present_flag u(1)  for( i = 0;brick_splitting_present_flag && i <  NumTilesInPic; i++ ) {  brick_split_flag[ i ] u(1)   if( brick_split_flag[ i ] ) {   uniform_brick_spacing_flag[ i ] u(1)    if(uniform_brick_spacing_flag[ i ] )     brick_height_minus1[ i ] ue(v)   else {     num_brick_rows_minus1[ i ] ue(v)     for( j = 0; j <num_brick_rows_minus1     [ i ]; j ++ )      brick_row_height_minus1 [ i][ j ] ue(v)    }   }  }  single_brick_per_slice_flag u(1)  if(!single_brick_per_slice_flag )   rect_slice_flag u(1)  if(rect_slice_flag && !single_brick_per_slice_flag ) {  num_slices_in_pic_minus1 ue(v)   for( i = 0; i <=num_slices_in_pic_minus1; i++) {    if( i > 0 )    top_left_brick_idx_minus1[ i ] u(v)    bottom_right_brick_idx_delta[i ] u(v)   }  }  loop_filter_across_bricks_enabled_flag u(1)  if(loop_filter_across_bricks_enabled_flag )  loop_filter_across_slices_enabled_flag u(1) }

As in an example shown in Table 9, a syntax, top left brick idxminus[i], representing an index of a top-left tile of the i-th tilegroup may be signaled in a bitstream. An index of a top-left tile alwayshas a value greater than 0 in a remaining tile group excluding the firsttile group in a current picture. Accordingly, encoding/decodingefficiency may be improved by encoding top_left_brick_idx_minus1[i]representing a value subtracting 1 from an index of a top-left tile. Forthe first tile group in a current picture, the encoding oftop_left_brick_idx_minus1[i] may be omitted. The number of bits of asyntax, top_left_brick_idx_minus1[i], may be determined as in thefollowing Equation 7.

Ceil(Log₂(NumBricksInPic−1))  [Equation 7]

In Equation 7, NumBricksInPic represents the number of tiles in apicture. A function, Ceil(a), represents the smallest integer which isgreater than or the same as a. An index of a top-left tile of the i-thtile group may be set as a value adding 1 totop_left_brick_idx_minus1[i].

Alternatively, at least one of horizontal index difference informationrepresenting an index difference between the first tile in a tile group(i.e., a top-left tile) and the rightmost tile belonging to the sametile row or vertical index difference information representing an indexdifference between the first tile in a tile group and the lowest tilebelonging to the same tile column may be encoded. In an example, atleast one of horizontal index difference information or vertical indexdifference information may be encoded and signaled in a tile groupadjacent to the right boundary or the lower boundary of a picture.

Alternatively, information representing a difference between an index ofa tile at a predetermined position in the first tile group and an indexof a tile at a predetermined position in the second tile group may besignaled in a bitstream. In this case, a predetermined position may beat least one of a top-left, a top-right, a bottom-left, a bottom-rightor a center of a tile group. In an example, a syntax,top_left_brick_idx_delta[i], representing a difference between an indexof a tile at a top-left position of the i-th tile group and an index ofa tile at a top-left position of the (i−1)-th or (i+1)-th tile group maybe signaled. For the first tile group or the last tile group, theencoding of a syntax, top_left_brick_idx_delta, representing adifference of an index between tiles may be omitted.

Table 10 represents a syntax table including information representing adifference of a top-left tile index between two tile groups.

TABLE 10 pic_parameter_set_rbsp( ) { Descriptor  . . . single_brick_per_slice_flag u(1)  if( !single_brick_per_slice_flag )  rect_slice_flag u(1)  if( rect_slice_flag &&!single_brick_per_slice_flag ) {   num_slices_in_pic_minus1 ue(v)   for(i = 0; i <= num_slices_in_pic_minus1; i++ ) {    if( i > 0 )    top_left_brick_idx_delta [ i ] u(v)   }  } loop_filter_across_bricks_enabled_flag u(1)  if(loop_filter_across_bricks_enabled_flag )  loop_filter_across_slices_enabled_flag u(1) }

In Table 10, a syntax, top_left_brick_idx_delta[i], represents adifference value between an index of a top-left tile of a previous tilegroup (e.g., the (i−1)-th tile group) and an index of a top-left tile ofa current tile group (e.g., the i-th tile group). When informationrepresenting a difference of a tile index between two tile groups isencoded, the encoding of information representing an index of a specifictile in a tile group (e.g., a syntax representing a position of atop-left tile and/or a syntax representing a position of a bottom-righttile) may be omitted.

An index of a top-left tile of the i-th tile group may be derived bycombining an index of a top-left tile of a previous tile group (i.e.,the i−1-th tile group) with top_left_brick_idx_delta[i]. In an example,Equation 8 represents an example in which an index of a top-left tile ofa current tile group is derived.

TopLeftBrickIdx[i]=TopLeftBrickIcbc[i−1]+top_left_brick_idx_delta[i]  [Equation8]

TopLeftBrickIdx[i] represents an index of a top-left tile in the i-thtile group and TopLeftBrickIdx[i−1] represents an index of a top-lefttile in the (i−1)-th tile group.

The maximum number of bits of a syntax, top_left_brick_idx_delta[i], maybe determined as in the following Equation 9.

Ceil(Log₂(NumBricksInPic?TopLeftBrickIdx(i−1)−1))  [Equation 9]

In Equation 9, NumBricksInPic represents the number of tiles included bya current picture and TopLeftBrickIdx(i−1) represents an index of atop-left tile in the (i−1)-th tile group.

For the first tile group (i.e., a tile group that i is 0), the encodingof a syntax, top_left_brick_idx_delta[i], may be omitted.TopLeftBrickIdx(0), an index of a top-left tile of the first slice maybe set to be 0.

For the second tile group (i.e., a tile group that i is 1),top_left_brick_idx[i] representing an index of a top-left tile in thesecond tile group may be encoded, instead of a syntax,top_left_brick_idx_delta[i], representing an index difference with atop-left tile of a previous tile group.

Unlike an example shown in Table 10, a syntax,top_left_brick_idx_delta[i], may be defined as a difference between anindex of a top-left tile of a current tile group (e.g., the i-th tilegroup) and an index of a top-left tile of a subsequent tile group (e.g.,the (i+1)-th tile group). In this case, the encoding of a syntax,top_left_brick_idx_delta[i], may be omitted for the last tile group.

Information representing an index difference value of bottom-right tilesin two tile groups may be encoded. In an example, Table 11 represents asyntax table including information representing an index differencevalue of bottom-right tiles in two tile groups.

TABLE 11 pic_parameter_set_rbsp( ) { Descriptor  . . . single_brick_per_slice_flag u(1)  if( !single_brick_per_slice_flag )  rect_slice_flag u(1)  if( rect_slice_flag &&!single_brick_per_slice_flag ) {   num_slices_in_pic_minus1 ue(v)   for(i = 0; i <= num_slices_in_pic_minus1; i++ ) {    if (i !=num_slices_in_pic_minus1)    bottom_right_brick_idx_diff[ i ] u(v)   } }  loop_filter_across_bricks_enabled_flag u(1)  if(loop_filter_across_bricks_enabled_flag )  loop_filter_across_slices_enabled_flag u(1) }

In Table 11, a syntax, bottom right brick idx diff[i], represents adifference value between an index of a bottom-right tile of a previoustile group (e.g., the (i−1)-th tile group) and an index of abottom-right tile of a current tile group (e.g., the i-th tile group).

An index of a bottom-right tile of the i-th tile group may be derived bycombining an index of a bottom-right tile of a previous tile group(i.e., the i−1-th tile group) with bottom_right_brick_idx_delta[i]. Inan example, Equation 10 represents an example of deriving an index of abottom-right tile of a current tile group.

BottomRightIdx[i]=BottomRightIdx[i−1]+bottom_right_brick_idx_diff[i]  [Equation10]

BottomRightIdx[i] represents an index of a bottom-right tile in the i-thtile group and BottomRightIdx[i−1] represents an index of a bottom-righttile in the (i−1)-th tile group.

The maximum number of bits of a syntax, bottom_right_brick_idx_delta[i],may be determined as in the following Equation 11.

Ceil(Log₂(NumBricksInPic?BottomRightIdx(i−1)))  [Equation 11]

BottomRightIdx[0], an index of a bottom-right tile of the first tilegroup (i.e., a tile group that i is 0), may be set the same asbottom_right_brick_idx_diff[0].

Unlike an example shown in Table 11, a syntax,bottom_right_brick_idx_diff[i], may be defined as a difference betweenan index of a bottom-right tile of a current tile group (e.g., the i-thtile group) and an index of a right tile of a subsequent tile group(e.g., the (i+1)-th tile group). In this case, the signaling ofbottom_right_brick_idx_diff[i] may be omitted for the last tile group.

A syntax derived by subtracting a preset value from a value representingan index difference of tiles at a predetermined position in two tilegroups may be encoded. Table 12 represents an example in which a valuesubtracting 1 from an index difference of top-left tiles in two tilegroups is encoded.

TABLE 12 pic_parameter_set_rbsp( ) { Descriptor  . . . single_brick_per_slice_flag u(1)  if( !single_brick_per_slice_flag )  rect_slice_flag u(1)  if( rect_slice_flag &&!single_brick_per_slice_flag ) {   num_slices_in_pic_minus1 ue(v)   for(i = 0; i <= num_slices_in_pic_minus1; i++ ) {    if( i > 0 )    top_left_brick_idx_delta_minus1[ i ] u(v)   }  } loop_filter_across_bricks_enabled_flag u(1)  if(loop_filter_across_bricks_enabled_flag )  loop_filter_across_slices_enabled_flag u(1) }

In Table 12, a syntax, top_left_brick_idx_delta minus1[i], represents avalue subtracting 1 from a difference value between an index of atop-left tile of a previous tile group (e.g., the (i−1)-th tile group)and an index of a top-left tile of a current tile group (e.g., the i-thtile group).

An index of a top-left tile of the i-th tile group may be derived byadding an index of a top-left tile of a previous tile group (i.e., the(i−1)-th tile group) and 1 to top_left_brick_idx_delta[i]. In anexample, Equation 12 represents an example of deriving an index of atop-left tile of a current tile group.

TopLeftBrickIdx[i]=TopLeftBrickIdx[i−1]+top_left_brick_idx_deltaminus1[i]+1  [Equation 12]

The maximum number of bits of a syntax, top_left_brick_idx_deltaminus1[i], may be determined as in the following Equation 13.

Ceil(Log₂(NumBricksInPic?TopLeftBrickIdx(i−1)))  [Equation 13]

When a tile at a predetermined position in a tile group is determined, atile group may be defined by using information representing a size of atile group. Information representing a size of a tile group may besignaled in a bitstream. In an example, a syntax, tilegroup width intiles minus1[i], representing a width of the i-th tile group and asyntax, tilegroup_height_in_tiles_minus1[i], representing a height ofthe i-th tile group may be signaled in a bitstream. A syntax,tilegroup_width_in_tiles_minus1[i], represents a value subtracting 1from the number of tile columns in the i-th tile group andtilegroup_height_in_tiles_minus1[i] represents a value subtracting 1from the number of tile rows in the i-th tile group.

When a top-left tile of the i-th tile group is specified by a syntax,top_left_brick_idx_delta[i−1], a width and a height of a tile group maybe determined based on tilegroup_width_in_tiles_minus1[i] andtilegroup_height_in_tiles_minus1[i]. For the last tile group in acurrent picture, the encoding of a syntax,tilegroup_width_in_tiles_minus1, and a syntax,tilegroup_height_in_tiles_minus1, may be omitted.

When both a syntax, tilegroup_width_in_tiles_minus1[i], and a syntax,tilegroup_height_in_tiles_minus1[i], are 0, it represents that a tilegroup is configured with only one tile or one tile is partitioned into aplurality of tiles.

When both a syntax, tilegroup_width_in_tiles_minus1[i], and a syntax,tilegroup_height_in_tiles_minus1[i], are 0, information representingwhether a tile is partitioned into a plurality of tile groups may besignaled. In an example, a syntax, num_exp_slices_in_tile[i],representing information representing the number of tile group heightswhich should be explicitly signaled, may be signaled in a bitstream. Asyntax, num_exp_slices_in_tile[i], may have a value which is the same asor smaller than the number of tile groups included by a tile. A syntax,exp_slice_height_in_ctu_minus1, representing heights of a slice may besignaled as many as the number specified by thenum_exp_slices_in_tile[i].

A syntax, exp_slice_height_in_ctu_minus1[j], represents a height of thej-th slice in a tile. Concretely, exp_slice_height_in_ctu_minus1represents a value subtracting 1 from the number of coding tree unitrows occupied by the j-th slice in a tile.

When a size of a coding tree unit row for a remaining region in a tileis greater than a value derived by adding 1 to lastly signaledexp_slice_height_in_ctu_minus1, a slice may be generated by repeatedlypartitioning the remaining region until a size of a coding tree unit rowfor the remaining region is the same as or smaller than the valuederived by adding 1 to the lastly signaledexp_slice_height_in_ctu_minus1.

When a syntax, num_exp_slices_in_tile[i], is 0, it represents that thei-th tile group is configured with a single tile. When a syntax,num_exp_slices_in_tile[i], is greater than 0, it represents that a tileincluding the i-th tile group is partitioned into a plurality of tilegroups.

When the number of tile columns in a current picture is 1, the encodingof a syntax, tilegroup_width_in_tiles_minus1, may be omitted and whenthe number of tile rows in a current picture is 1, the encoding of asyntax, tilegroup_height_in_tiles_minus1, may be omitted.

Alternatively, the encoding of at least one of information representinga width of a tile group or information representing a size of a tilegroup may be omitted. In an example, the encoding of a syntax,tilegroup_width_in_tiles_minus1, representing a width of a tile groupmay be omitted and a distance with a tile at a predetermined position inan adjacent tile group may be set as a width of a tile group.Concretely, a top-left tile of the (i+1)-th tile group adjacent to theright of the i-th tile group may be specified by a syntax,top_left_brick_idx_delta[i]. A width of the i-th tile group may bederived by a difference between an x-coordinate of a top-left tile inthe i-th tile group (e.g., an x-coordinate of a top-left sample) and anx-coordinate of a top-left tile in the i+l-th tile group (e.g., anx-coordinate of a top-left sample).

Alternatively, the encoding of a syntax,tilegroup_height_in_tiles_minus1, representing a height of a tile groupmay be omitted and a distance with a tile at a predetermined position inan adjacent tile group may be set as a width of a tile group.Concretely, a top-left tile of the j-th tile group positioned at thebottom of the i-th tile group may be specified by a syntax,top_left_brick_idx_delta[j−1]. A height of the i-th tile group may bederived by a difference between a y-coordinate of a top-left tile in thei-th tile group (e.g., a y-coordinate of a top-left sample) and ay-coordinate of a top-left tile in the j-th tile group (e.g., ay-coordinate of a top-left sample).

Alternatively, in defining a rectangular tile group, informationrepresenting whether difference value information is used may besignaled in a bitstream. In an example, delta present flag representingwhether difference value information is used may be signaled in abitstream. When a value of a syntax, delta_present_flag, is 1, itrepresents that a syntax representing a difference value of a tile indexis encoded and signaled. In an example, when a value of a syntax,delta_present_flag, is 1, the i-th tile group may be defined by asyntax, tilegroup_width_in_tiles_minus1[i], and a syntax,tilegroup_height_in_tiles_minus1[i], representing a size of a tile groupand difference value information for determining a position of atop-left tile or a position of a top-right tile in a tile group (e.g.,top_left_brick_idx_delta[i−1] or bottom_right_brick_idx_delta[i])

When a value of a syntax, delta_present_flag, is 0, the i-th tile groupmay be defined by a syntax, tilegroup_width_in_tiles_minus1[i], and asyntax, tilegroup_height_in_tiles_minus1[i], representing a size of atile group. When a value of a syntax, delta_present_flag, is 0, a tilegroup adjacent to the right of a tile group adjoining the left boundaryof a current picture may be set to have the same height each other.Accordingly, information representing a height of a tile group may besignaled only for a tile group which adjoins the left boundary of acurrent picture and the signaling of information representing a heightof a tile group may be omitted for tile groups which do not adjoin theleft boundary of a current picture.

It is possible to define a tile group based on an index of a coding treeunit, instead of an index of a tile group.

The above-mentioned example described that a tile group is defined inthe raster scanning order of tiles, but it is also possible that a tilegroup may be defined according to a vertical scan, a horizontal scan ora diagonal scan.

Information indicating whether a size of a previous tile group is thesame as that of a current tile group may be signaled. In thisconnection, the previous tile group may be determined based on an indexof a tile group or a predetermined scanning order. In an example, aprevious tile group may be determined as a tile group whose index issmaller than a current tile group by 1. Alternatively, a previous tilegroup may be determined according to at least one of a raster scanningorder, a horizontal scanning order, a vertical scanning order or adiagonal scanning order.

The above information may include at least one of information indicatingwhether a size of a previous tile group is the same as that of a currenttile group, information indicating whether a width of a previous tilegroup is the same as that of a current tile group or informationindicating whether a height of a previous tile group is the same as thatof a current tile group.

In an example, a syntax, use_previous_TG_size_flag, indicating whether asize of a current tile group is the same as that of a previous tilegroup may be signaled. If a syntax, use_previous_TG_size_flag[i], is 1,it represents that a size of an i-th tile group is the same as that ofan (i−1)th tile group. When a syntax, use_previous_TG_size_flag[i], is1, encoding of information for determining tiles included in i-th tilegroup may be omitted. For example, encoding of information representingthe number of tiles included in a tile group or information representingan index of tiles included in a tile group may be omitted.

If a syntax, use_previous_TG_size_flag[i], is 0, it represents that asize of an i-th tile group is different from that of an (i−1)th tilegroup. When a syntax, use_previous_TG_size_flag[i], is 0, informationfor determining tiles included in an i-th tile group may be encoded andsignaled.

The above-mentioned embodiments described that a tile group is definedafter partitioning a current picture into at least one or more tiles. Inanother example, a tile group may be partitioned into a plurality oftiles after defining a tile group first.

Table 13 is a diagram showing an example in which each tile group ispartitioned into at least one tiles.

TABLE 13 pic_parameter_set_rbsp( ) { Descriptor pps_pic_parameter_set_idue(v) pps_seg_parameter_set_id ue(v) transform_skip_enabled_flag u(1)single_tile_in_pic_flag u(1)  single_tile_per_tile_group_flag u(1) if(!single_tile_per_tile_group_flag )   rect_tile_group_flag u(1)  if(rect_tile_group_flag  && !single_tile_per_tile_group_flag ) {  num_tile_groups_in_pic_minus1 ue(v) if( !single_tile_in_pic_flag ) { num_tile_columns_minus1 ue(v)  num_tile_rows_minus1 ue(v) } uniform_tile_spacing_flag u(1)   for( i = 0; i <=num_tile_groups_in_pic_minus1; i++ ) {    if( i > 0)    top_left_tile_idx[ i ] u(v)      bottom_right_tile_idx[ i ] u(v)    num_tile_column_minus_inTG[i]     num_tile_rows_minus1_inTG[i]       if (!uniform_tile_spacing_flag){      uniform_tile_spacing_inTG[i] if (!uniform_tile_spacing_inTG[i]){for( j = 0; j < num_tile_columns_minus1_inTG[i]; j++ ) tile_column_width_minus1[ i ][j] ue(v)  for( j = 0; j <num_tile_rows_minus1_inTG[i]; j++ )  tile_row_height_minus1[ i ] [j]ue(v)     }    }   }  }  loop_filter_across_tiles_enabled_flag u(1) }if( rect_tile_group_flag ) {  signalled_tile_group_id_flag u(1)  if(signalled_tile_group_id_flag ) {   signalled_tile_group_id_length_minus1ue(v)   for( i = 0; i <= num_tile_groups_in_pic_minus1; i++ )   tile_group_id[ i ] u(v)  }  rbsp_trailing_bits( ) }

Information on configuration of a tile group in a picture may besignaled in a bitstream. Information on configuration of a tile groupmay include at least one of information representing whether a pictureis configured with one tile, information representing whether each tilegroup is configured with one tile, information representing whether atile group is rectangular, information representing the number of tilegroups, information representing the number of tile group columns orinformation representing the number of tile group rows.

In an example, a syntax, single_tile_in_pic_flag, representing whether acurrent picture is partitioned into a plurality of tiles, may besignaled in a bitstream. When a syntax, single_tile_in_pic_flag, is 1,it represents that a current picture is not partitioned into a pluralityof tiles and the number of tile groups in a current picture is 1. When asyntax, single_tile_in_pic_flag, is 0, it represents that a currentpicture is partitioned into a plurality of tiles.

When a picture is determined to be partitioned into a plurality oftiles, a syntax, single tile per tile group flag, representing whethereach tile group is configured with one tile, may be signaled in abitstream. When a syntax, single_tile_per_tile_group_flag, is 1, itrepresents that each tile group is configured with only one tile. When asyntax, single_tile_per_tile_group_flag, is 0, it represents that atleast one tile group is configured with a plurality of tiles.

When at least one tile group is determined to be configured with aplurality of tiles, partitioning information of each tile group may besignaled in a bitstream. In an example, uniform_tile_spacing_inTG[i]representing whether the i-th tile group is partitioned into tiles witha uniform size may be signaled in a bitstream. A syntax,uniform_tile_spacing_inTG[i], may be signaled only whenuniform_tile_spacing_flag is 0. When a syntax,uniform_tile_spacing_inTG[i], is not signaled, that value may beinferred to be 0. Alternatively, according to a shape of a tile group,whether uniform_tile_spacing_inTG[i] is encoded may be determined. In anexample, a syntax, uniform_tile_spacing_inTG[i], may be encoded onlywhen a tile group has a rectangular shape. When a tile group has anon-rectangular shape, the encoding of uniform_tile_spacing_inTG[i] maybe omitted.

A syntax, num_tile_columns_minus_in_TG[i], representing the number oftile columns included in the i-th tile group may be signaled. Inaddition, a syntax, num_tile_rows_minus_in_TG[i], representing thenumber of tile rows included in the i-th tile group may be signaled.

A syntax, tile_column_width_minus[i][j], representing a width of a tilecolumn included in a tile group, may be signaled per each tile group. Asyntax, tile_column_width_minus[i][j], represents a width of the j-thtile column in the i-th tile group. In addition, a syntax,tile_row_height_minus[i][j], representing a height of a tile rowincluded in a tile group may be signaled per each tile group. A syntax,tile_row_height_minus[i][j], represents a height of the j-th tile row inthe i-th tile group.

Applying the embodiments as described about the decoding process or theencoding process to the encoding process or the decoding processrespectively may be included in the scope of the present disclosure.Within the scope of the present disclosure, the embodiments in whichoperations occur in a predetermined order may be modified to embodimentsin which the operations occur in a different order from thepredetermined order.

Although the above-described embodiment is described based on a seriesof the operations or the flowchart, the embodiment does not limit atime-series order of the operations of the method thereto. In anotherexample, the operations may be performed simultaneously or in adifferent order therefrom as necessary. Further, in the above-describedembodiment, each of the components (for example, a unit, a module, etc.)constituting the block diagram may be implemented in a form of ahardware device or software. A plurality of components may be combinedwith each other into a single component which may be implemented using asingle hardware device or software. The above-described embodiment maybe implemented using program instructions that may be executed viavarious computer components. The instructions may be recorded in acomputer-readable storage medium. The computer-readable storage mediummay contain therein program instructions, data files, data structures,or the like alone or in combination with each other. Examples of thecomputer-readable storage media include magnetic media such as harddisks, floppy disks, and magnetic tapes, optical storage media such asCD-ROMs, DVDs, and magneto-optical media such as floptical disks, andhardware devices such as ROM, RAM, flash memory, and the likespecifically configured to store therein and execute the programinstructions. The hardware device may be configured to operate as one ormore software modules to perform processing according to the presentdisclosure, and vice versa.

INDUSTRIAL AVAILABILITY

The present disclosure may be applied to an electronic device thatencodes/decodes video.

What is claimed is:
 1. A method of decoding a video, the methodcomprising: decoding information indicating a slice determination methodwhen a current picture is partitioned into a plurality of tiles, theinformation indicating the slice determination method indicating whetherit is defined based on a definition method based on a raster scanningorder or a definition method based on a rectangular shape; and definingat least one tile as a slice; and wherein when the slice determinationmethod represents the definition method based on the rectangular shape,a first slice is defined based on a tile at a preset position in thefirst slice, wherein when the first slice is not a last slice in thecurrent picture, a first syntax for identifying the tile at the presetposition in the first slice is parsed in a bitstream, and wherein whenthe first slice is the last slice in the current picture, parsing of thefirst syntax is omitted.
 2. The method of claim 1, wherein the firstsyntax represents an index difference value between the tile at thepreset position in the first slice and a tile at a preset position in asecond slice.
 3. The method of claim 1, wherein the first syntaxrepresents a value subtracting a predetermined value from an indexdifference value between the tile at the preset position in the firstslice and a tile at a preset position in a second slice.
 4. The methodof claim 1, wherein when the first slice is not the last slice in thecurrent picture, a second syntax representing a size of the first sliceis additionally parsed, and wherein when the first slice is the lastslice in the current picture, parsing of the second syntax is omitted.5. The method of claim 1, wherein when the slice determination methodrepresents the definition method based on the raster scanning method,the first slice is determined based on a number of tiles included in thefirst slice, wherein when the first slice is not the last slice in thecurrent picture, a third syntax representing the number of tilesincluded in the first slice is parsed in a bitstream, and wherein whenthe first slice is the last slice in the picture, parsing of the thirdsyntax is omitted.
 6. A method of encoding a video, the methodcomprising: encoding information indicating a slice determination methodwhen a current picture is partitioned into a plurality of tiles, theinformation indicating the slice determination method indicating whetherit is defined based on a definition method based on a raster scanningorder or a definition method based on a rectangular shape; and definingat least one tile as a slice; and wherein when the slice determinationmethod is the definition method based on the rectangular shape, a firstslice is defined based on a tile at a preset position in the firstslice, wherein when the first slice is not a last slice in the currentpicture, a first syntax for identifying the tile at the preset positionin the first slice is encoded in a bitstream, and wherein when the firstslice is the last slice in the current picture, encoding of the firstsyntax is omitted.
 7. The method of claim 6, wherein the first syntaxrepresents an index difference value between the tile at the presetposition in the first slice and a tile at a preset position in a secondslice.
 8. The method of claim 6, wherein the first syntax represents avalue subtracting a predetermined value from an index difference valuebetween the tile at the preset position in the first slice and a tile ata preset position in a second slice.
 9. The method of claim 6, whereinwhen the first slice is not the last slice in the current picture, asecond syntax representing a size of the first slice is additionallyencoded, wherein when the first slice is the last slice in the currentpicture, encoding of the second syntax is omitted.
 10. The method ofclaim 6, wherein when the slice determination method is the definitionmethod based on the raster scanning method, the first slice isdetermined based on a number of tiles included in the first slice,wherein when the first slice is not the last slice in the currentpicture, a third syntax representing the number of tiles included in thefirst slice is encoded in a bitstream, and wherein when the first sliceis the last slice in the picture, encoding of the third syntax isomitted.